ParamSpecPool

class ParamSpecPool(*args, **kwargs)

A ParamSpecPool maintains a collection of ParamSpec which can be quickly accessed by owner and name.

The implementation of the Object property system uses such a pool to store the ParamSpec of the properties all object types.

Methods

class ParamSpecPool
free() None

Frees the resources allocated by a ParamSpecPool.

Added in version 2.80.

insert(pspec: ParamSpec, owner_type: type) None

Inserts a ParamSpec in the pool.

Parameters:
  • pspec – the ParamSpec to insert

  • owner_type – a Type identifying the owner of pspec

list(owner_type: type) list[ParamSpec]

Gets an array of all ParamSpec owned by owner_type in the pool.

Parameters:

owner_type – the owner to look for

list_owned(owner_type: type) list[ParamSpec]

Gets an GList of all ParamSpec owned by owner_type in the pool.

Parameters:

owner_type – the owner to look for

lookup(param_name: str, owner_type: type, walk_ancestors: bool) ParamSpec | None

Looks up a ParamSpec in the pool.

Parameters:
  • param_name – the name to look for

  • owner_type – the owner to look for

  • walk_ancestors – If True, also try to find a ParamSpec with param_name owned by an ancestor of owner_type.

remove(pspec: ParamSpec) None

Removes a ParamSpec from the pool.

Parameters:

pspec – the ParamSpec to remove