pg.typing.callable_eq

Accessible via pg.typing.callable_eq.

callable_eq(x, y)[source]

Returns True if two (maybe) callables are equal.

Return type:

bool

For functions: x and y are considered equal when they are the same

instance or have the same code (e.g. lambda x: x).

For methods: x and y are considered equal when:
static method: The same method from the same class hierarchy. E.g. subclass

inherits a base class’ static method.

class method: The same method from the same class. Inherited class method

are considered different class method.

instance method: When self is not bound, the same method from the same

class hierarchy (like static method). When self is bound, the same method on the same object.

Parameters:
  • x – An optional function or method object.

  • y – An optinoal function or method object.

Returns:

Returns True if x and y are considered equal. Meaning that they are

either the same instance or derived from the same code and have the same effect.