Reflection Utils¶
removed¶
-
treetensor.utils.reflection.
removed
(obj)[source]¶ - Overview:
Add
__removed__
attribute to the given object. The givenobject
will be marked as removed, will be removed whenclass_autoremove()
ormodule_autoremove()
is used.- Arguments:
obj: Given object to be marked.
- Returns:
marked: Marked object.
class_autoremove¶
module_autoremove¶
-
treetensor.utils.reflection.
module_autoremove
(module: module)[source]¶ - Overview:
Remove the items which are marked as removed in the given
module
.- Arguments:
module (
ModuleType
): Given module.
- Returns:
marked (
ModuleType
): Marked module.
Examples:
>>> # At the imports' part >>> import sys >>> >>> # At the very bottom of the module >>> sys.modules[__name__] = module_autoremove(sys.modules[__name__]) >>>