podio.pythonizations package

Subpackages

Submodules

podio.pythonizations.collection_subscript module

Pythonize subscript operation for collections

class podio.pythonizations.collection_subscript.CollectionSubscriptPythonizer

Bases: Pythonizer

Bound-check __getitem__ for classes derived from podio.CollectionBase

classmethod filter(class_, name)

Filters-out classes non derived from podio.CollectionBase.

Parameters:
  • class (type) – Class object.

  • name (str) – Name of the class.

Returns:

True if class is derived from podio.CollectionBase and should be pythonized.

Return type:

bool

classmethod modify(class_, name)

Raise an IndexError exception if an index is invalid. The __getitem__ will return immutable datatype objects instead of the mutable ones.

Parameters:
  • class (type) – Class object.

  • name (str) – Name of the class.

classmethod priority()

No special requirements for order of applying

Returns:

Priority.

Return type:

int

podio.pythonizations.freeze_class module

Prevent creating new attributes for existing objects The new attributes created in Python won’t be visible for podio IO therefore preventing the addition of new attributes for podio objects might be desirable and help detecting mis-assignments

class podio.pythonizations.freeze_class.FreezeClassPythonizer

Bases: Pythonizer

Prevent setting new attributes

classmethod filter(class_, name)

Filter passing all the classes

Parameters:
  • class (type) – Class object.

  • name (str) – Name of the class.

Returns:

True.

Return type:

bool

classmethod modify(class_, name)

Raise an AttributeError if new attribute would be set

Parameters:
  • class (type) – Class object.

  • name (str) – Name of the class.

classmethod priority()

This most likely should be the last pythonization loaded. Otherwise it may interfere with creating attributes during other pythonizations.

Returns:

Priority.

Return type:

int

Module contents

cppyy pythonizations for podio

podio.pythonizations.load_pythonizations(namespace)

Register all available pythonizations for a given namespace