typing库

  1. typing库typing.py中所有类型有哪些?如下所示:
__all_ = [
# Super-special typing primitives.
'Any', 'Callable', 'ClassVar', 'Generic', 'Optional', 'Tuple', 'Type', 'TypeVar', 'Union',
#ABCs (from collections.abc).
'AbstractSet', 'ByteString', 'Container', 'ContextManager', 'Hasshable', 'ItemsView', "Iterable', 'Iterator', "KeysView', "Mapping',
'MappingView', 'MutableMapping', "MutableSequence', 'MutableSet', 'Sequence', 'Sized', 'ValuesView', 'Awaitable', 'AsyncIterator', 
'AsyncIterable', 'Coroutine', 'Collection', 'AsyncGenerator', 'AsyncContextManager',
#structural checks a.k.a.protocols.
'Reversible', 'SupportsAbs', 'SupportsBytes', 'SupportsComplex', "SupportsFloat', 'SupportsInt', 'SupportsRound',
#Concrete collection types
'Counter', 'Deque', 'Dict', 'DefaultDict', 'List', 'Set', 'FrozenSet', 'NameTuple', 'Generator',
#one-off things
'AnyStr', 'cast', 'get_type_hints', 'NewType', 'no_type_check', 'no_type_check_decorator', 'NoReturn', 'overload', ’Text', 'TYPE_CHECKING',]
  1. TypeVar类型重定义(也就是用户自己定义的泛型类型)
    !类似于C语言的typedef在这里插入图片描述

你可能感兴趣的:(Python,智能家居)