Skip to content

Commit

Permalink
Changes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Nov 11, 2021
1 parent bdc560f commit 12ec8de
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
18 changes: 18 additions & 0 deletions typing_extensions/CHANGELOG
Expand Up @@ -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
12 changes: 5 additions & 7 deletions typing_extensions/src_py3/typing_extensions.py
@@ -1,6 +1,7 @@
import abc
import collections
import collections.abc
import operator
import sys
import typing

Expand Down Expand Up @@ -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',
Expand All @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 12ec8de

Please sign in to comment.