Home
last modified time | relevance | path

Searched refs:GenericAlias (Results 1 – 25 of 49) sorted by relevance

12

/third_party/python/Doc/c-api/
Dtypehints.rst9 two types exist -- :ref:`GenericAlias <types-genericalias>` and
10 :ref:`Union <types-union>`. Only ``GenericAlias`` is exposed to C.
14 Create a :ref:`GenericAlias <types-genericalias>` object.
16 :class:`types.GenericAlias`. The *origin* and *args* arguments set the
17 ``GenericAlias``\ 's ``__origin__`` and ``__args__`` attributes respectively.
24 The ``GenericAlias``\ 's ``__parameters__`` attribute is constructed lazily
45 :class:`types.GenericAlias` in Python.
/third_party/python/Lib/test/
Dtest_genericalias.py36 from types import GenericAlias, MappingProxyType, AsyncGeneratorType
168 a = types.GenericAlias(list, int)
273 alias = GenericAlias(list, T)
289 alias = GenericAlias(origin, T)
327 GenericAlias(bad=float)
330 class SubClass(GenericAlias): ...
332 class Bad(GenericAlias):
Dtest_genericclass.py272 from _testcapi import Generic, GenericAlias
273 self.assertIsInstance(Generic.__class_getitem__(int), GenericAlias)
276 self.assertIs(type(IntGeneric), GenericAlias)
/third_party/python/Lib/
D_collections_abc.py12 GenericAlias = type(list[int]) variable
119 __class_getitem__ = classmethod(GenericAlias)
180 __class_getitem__ = classmethod(GenericAlias)
268 __class_getitem__ = classmethod(GenericAlias)
402 __class_getitem__ = classmethod(GenericAlias)
416 class _CallableGenericAlias(GenericAlias):
537 if isinstance(obj, GenericAlias):
863 __class_getitem__ = classmethod(GenericAlias)
Dqueue.py220 __class_getitem__ = classmethod(types.GenericAlias)
322 __class_getitem__ = classmethod(types.GenericAlias)
Dtyping.py31 from types import WrapperDescriptorType, MethodWrapperType, MethodDescriptorType, GenericAlias
192 if isinstance(obj, types.GenericAlias):
217 if isinstance(t, (_GenericAlias, GenericAlias, types.UnionType)):
327 if isinstance(t, (_GenericAlias, GenericAlias, types.UnionType)):
331 if isinstance(t, GenericAlias):
332 return GenericAlias(t.__origin__, ev_args)
1057 elif isinstance(arg, (_GenericAlias, GenericAlias, types.UnionType)):
1866 if isinstance(t, GenericAlias):
1870 return GenericAlias(t.__origin__, stripped_args)
1897 if isinstance(tp, (_BaseGenericAlias, GenericAlias,
[all …]
Dfunctools.py22 from types import GenericAlias
416 __class_getitem__ = classmethod(GenericAlias)
743 and not isinstance(typ, GenericAlias)
842 return isinstance(cls, type) and not isinstance(cls, GenericAlias)
992 __class_getitem__ = classmethod(GenericAlias)
D_weakrefset.py6 from types import GenericAlias
206 __class_getitem__ = classmethod(GenericAlias)
Dcontextlib.py7 from types import MethodType, GenericAlias
19 __class_getitem__ = classmethod(GenericAlias)
41 __class_getitem__ = classmethod(GenericAlias)
Dtypes.py85 if isinstance(base, type) and not isinstance(base, GenericAlias):
300 GenericAlias = type(list[int]) variable
Dfilecmp.py16 from types import GenericAlias
255 __class_getitem__ = classmethod(GenericAlias)
Dfileinput.py70 from types import GenericAlias
415 __class_getitem__ = classmethod(GenericAlias)
Ddataclasses.py11 from types import FunctionType, GenericAlias
232 if isinstance(self.type, type) and not isinstance(self.type, GenericAlias):
312 __class_getitem__ = classmethod(GenericAlias)
1214 cls = obj if isinstance(obj, type) and not isinstance(obj, GenericAlias) else type(obj)
Dtempfile.py678 __class_getitem__ = classmethod(_types.GenericAlias)
861 __class_getitem__ = classmethod(_types.GenericAlias)
Dos.py31 GenericAlias = type(list[int]) variable
1085 __class_getitem__ = classmethod(GenericAlias)
Ddifflib.py35 from types import GenericAlias
663 __class_getitem__ = classmethod(GenericAlias)
/third_party/python/Doc/library/
Dtypes.rst293 .. class:: GenericAlias(t_origin, t_args)
302 >>> from types import GenericAlias
304 >>> list[int] == GenericAlias(list, (int,))
306 >>> dict[str, int] == GenericAlias(dict, (str, int))
/third_party/python/Lib/concurrent/futures/
Dthread.py66 __class_getitem__ = classmethod(types.GenericAlias)
D_base.py557 __class_getitem__ = classmethod(types.GenericAlias)
/third_party/python/Misc/NEWS.d/
D3.10.0a3.rst17 ``types.GenericAlias`` will now raise a ``TypeError`` when attempting to
178 :class:`types.GenericAlias` objects can now be the targets of weakrefs.
237 Allow ``GenericAlias`` objects to use :ref:`union type expressions
240 fixes union type expressions not de-duplicating ``GenericAlias`` objects.
D3.10.1.rst176 Fix deepcopying of :class:`types.GenericAlias` objects.
368 :class:`types.GenericAlias` instance as a base.
378 :class:`types.GenericAlias`.
895 Amend the docs on ``GenericAlias`` objects to clarify that non-container
/third_party/python/Lib/multiprocessing/
Dqueues.py380 __class_getitem__ = classmethod(types.GenericAlias)
Dshared_memory.py532 __class_getitem__ = classmethod(types.GenericAlias)
/third_party/python/Lib/http/
Dcookies.py423 __class_getitem__ = classmethod(types.GenericAlias)
/third_party/python/Lib/ctypes/
D__init__.py454 __class_getitem__ = classmethod(_types.GenericAlias)

12