MCPcopy Index your code
hub / github.com/python/mypy / get_class_decorator_hook

Method get_class_decorator_hook

mypy/plugin.py:728–744  ·  view source on GitHub ↗

Update class definition for given class decorators. The plugin can modify a TypeInfo _in place_ (for example add some generated methods to the symbol table). This hook is called after the class body was semantically analyzed, but *there may still be placeholders* (typically

(self, fullname: str)

Source from the content-addressed store, hash-verified

726 return None
727
728 def get_class_decorator_hook(self, fullname: str) -> Callable[[ClassDefContext], None] | None:
729 """Update class definition for given class decorators.
730
731 The plugin can modify a TypeInfo _in place_ (for example add some generated
732 methods to the symbol table). This hook is called after the class body was
733 semantically analyzed, but *there may still be placeholders* (typically
734 caused by forward references).
735
736 NOTE: Usually get_class_decorator_hook_2 is the better option, since it
737 guarantees that there are no placeholders.
738
739 The hook is called with full names of all class decorators.
740
741 The hook can be called multiple times per class, so it must be
742 idempotent.
743 """
744 return None
745
746 def get_class_decorator_hook_2(
747 self, fullname: str

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected