wtypes.python_types
¶
Module Contents¶
-
class
wtypes.python_types.
_NoType
¶
-
class
wtypes.python_types.
_ForwardSchema
¶ Bases:
wtypes.base._ContextMeta
A forward reference to an object, the object must exist in sys.modules.
Notes
Python types live on the __annotations__ attribute.
-
_type_args
¶
-
_type_kwargs
¶
-
__getitem__
(cls, object)¶
-
validate
(cls, object)¶
-
eval
(cls)¶
-
__add__
(cls, object)¶
-
-
class
wtypes.python_types.
_ArgumentSchema
¶ Bases:
wtypes.python_types._ForwardSchema
-
__getitem__
(cls, object)¶
-
-
class
wtypes.python_types.
Args
¶ Bases:
wtypes.python_types._NoType
,wtypes.base._NoInit
,wtypes.base._NoTitle
-
class
wtypes.python_types.
Kwargs
¶ Bases:
wtypes.python_types._NoType
,wtypes.base._NoInit
,wtypes.base._NoTitle
-
class
wtypes.python_types.
Forward
¶ Create type using objects or forward references.
Examples
>>> assert Forward['builtins.range']() is range
-
class
wtypes.python_types.
Class
¶ Bases:
wtypes.python_types.Forward
Create type using objects or forward references.
Examples
>>> assert isinstance(range, Class['builtins.range'])
-
classmethod
validate
(cls, object)¶
-
classmethod
-
class
wtypes.python_types.
Instance
¶ Bases:
wtypes.python_types.Forward
Create an instance of a type using objects or forward references.
Examples
>>> assert (Instance[range] + Args[10, 20])() == range(10, 20) >>> assert (Instance['builtins.range'] + Args[10, 20])() == range(10, 20) >>> assert isinstance(range(10), Instance['builtins.range'])
Deffered references.
>>> assert not isinstance(1, Instance['pandas.DataFrame']) >>> assert 'pandas' not in __import__('sys').modules
-
classmethod
validate
(cls, object)¶
-
classmethod