diff --git a/typing_extensions/CHANGELOG b/typing_extensions/CHANGELOG index d8820afa0..ac8f868a8 100644 --- a/typing_extensions/CHANGELOG +++ b/typing_extensions/CHANGELOG @@ -2,3 +2,21 @@ Starting with version 4.0.0, typing_extensions uses Semantic Versioning. See the README for more information. + +Dropped support for Python versions 3.5 and older. + +Simplified backports for Python 3.6.0 and newer. +Patch by Adam Turner (@AA-Turner). + +## Removed in version 4.0.0 + +The following non-exported but non-private names have been removed as they are +unneeded for supporting Python 3.6 and newer. + +- TypingMeta +- OLD_GENERICS +- SUBS_TREE +- HAVE_ANNOTATED +- HAVE_PROTOCOLS +- V_co +- VT_co diff --git a/typing_extensions/src_py3/typing_extensions.py b/typing_extensions/src_py3/typing_extensions.py index cf429a892..1e96d1460 100644 --- a/typing_extensions/src_py3/typing_extensions.py +++ b/typing_extensions/src_py3/typing_extensions.py @@ -1,6 +1,7 @@ import abc import collections import collections.abc +import operator import sys import typing @@ -67,11 +68,15 @@ def _check_generic(cls, parameters): 'SupportsIndex', # One-off things. + 'Annotated', 'final', 'IntVar', 'Literal', 'NewType', 'overload', + 'Protocol', + 'runtime', + 'runtime_checkable', 'Text', 'TypeAlias', 'TypeGuard', @@ -81,8 +86,6 @@ def _check_generic(cls, parameters): if PEP_560: __all__.extend(["get_args", "get_origin", "get_type_hints"]) -__all__.extend(['Annotated', 'Protocol', 'runtime', 'runtime_checkable']) - # 3.6.2+ if hasattr(typing, 'NoReturn'): NoReturn = typing.NoReturn @@ -1043,9 +1046,6 @@ def _typeddict_new(*args, total=True, **kwargs): class _TypedDictMeta(type): def __init__(cls, name, bases, ns, total=True): - # In Python 3.4 and 3.5 the __init__ method also needs to support the - # keyword arguments. - # See https://www.python.org/dev/peps/pep-0487/#implementation-details super().__init__(name, bases, ns) def __new__(cls, name, bases, ns, total=True): @@ -1130,8 +1130,6 @@ class Point2D(TypedDict): _AnnotatedAlias = typing._AnnotatedAlias # 3.7-3.8 elif PEP_560: - import operator - class _AnnotatedAlias(typing._GenericAlias, _root=True): """Runtime representation of an annotated type.