Runtime Utility Functions
types.prepare_class()
Select the metaclass, prepare a namespace and return the remaining header keywords with metaclass removed. Does not itself create the class.
Formal Syntax & Structure
python syntaxpython
types.prepare_class(name, bases=(), kwds=None)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| name | str | Name of the class to create or prepare. |
| bases | tuple | Original base class entries. |
| kwds | dict or None | Class-header keyword arguments, including an optional metaclass. |
Return Value
tuple
The tuple result described above.
Working Example
Example Snippetpython
import typesmeta, ns, kwds=types.prepare_class("C")ns["value"]=8C=meta("C",(),ns,**kwds)print(C().value)