Skip to content

Add typing_extensions.evaluate_forward_ref #488

Closed

Description

@befeleme

We're building typing_extensions 4.12.2 with Python 3.14.0a1 in Fedora Linux. Unittests fail during the build:

+ /usr/bin/python3 -m unittest discover
.F................................................................................................................................................................s..s..s........................................................................................................................................................................................s.........................................s.s...............................s........
======================================================================
FAIL: test_drop_in_for_typing (test_typing_extensions.AllTests.test_drop_in_for_typing)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-typing-extensions-4.12.2-build/typing_extensions-4.12.2/src/test_typing_extensions.py", line 5747, in test_drop_in_for_typing
    self.assertGreaterEqual(te_all, t_all - exceptions)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: {'final', 'SupportsComplex', 'TYPE_CHECKING', 'Generator', 'Dict', 'Required', 'MutableSequence', 'cast', 'no_type_check_decorator', 'OrderedDict', 'ParamSpec', 'ChainMap', 'Collection', 'Deque', 'Container', 'clear_overloads', 'IO', 'NotRequired', 'NoReturn', 'NamedTuple', 'LiteralString', 'Set', 'Self', 'Awaitable', 'MutableSet', 'AsyncGenerator', 'TypeIs', 'Literal', 'Mapping', 'Iterator', 'DefaultDict', 'ClassVar', 'ParamSpecArgs', 'MutableMapping', 'CapsuleType', 'get_origin', 'ValuesView', 'is_typeddict', 'Match', 'SupportsFloat', 'TextIO', 'Doc', 'get_type_hints', 'Final', 'NewType', 'TypeAliasType', 'Reversible', 'FrozenSet', 'Never', 'AsyncContextManager', 'Hashable', 'get_args', 'ReadOnly', 'runtime', 'BinaryIO', 'TypeVar', 'Sized', 'IntVar', 'Optional', 'AsyncIterator', 'Any', 'ItemsView', 'Coroutine', 'MappingView', 'KeysView', 'is_protocol', 'get_overloads', 'Annotated', 'AnyStr', 'NoDefault', 'dataclass_transform', 'Buffer', 'TypeAlias', 'get_protocol_members', 'SupportsBytes', 'overload', 'Sequence', 'Unpack', 'AbstractSet', 'reveal_type', 'ParamSpecKwargs', 'SupportsAbs', 'Text', 'SupportsIndex', 'Type', 'TypedDict', 'Counter', 'Union', 'Pattern', 'get_original_bases', 'Protocol', 'SupportsRound', 'TypeVarTuple', 'assert_never', 'List', 'Iterable', 'Concatenate', 'runtime_checkable', 'Tuple', 'TypeGuard', 'override', 'no_type_check', 'deprecated', 'AsyncIterable', 'ForwardRef', 'ContextManager', 'Callable', 'Generic', 'SupportsInt', 'assert_type'} not greater than or equal to {'final', 'SupportsComplex', 'AsyncContextManager', 'evaluate_forward_ref', 'TYPE_CHECKING', 'Hashable', 'Generator', 'get_args', 'ReadOnly', 'Dict', 'Required', 'MutableSequence', 'cast', 'BinaryIO', 'TypeVar', 'Sized', 'no_type_check_decorator', 'OrderedDict', 'Optional', 'ParamSpec', 'ChainMap', 'AsyncIterator', 'Any', 'ItemsView', 'Collection', 'Coroutine', 'MappingView', 'KeysView', 'is_protocol', 'get_overloads', 'Deque', 'Annotated', 'AnyStr', 'NoDefault', 'Container', 'clear_overloads', 'dataclass_transform', 'IO', 'NotRequired', 'NoReturn', 'TypeAlias', 'get_protocol_members', 'SupportsBytes', 'NamedTuple', 'LiteralString', 'Sequence', 'overload', 'AbstractSet', 'Set', 'Unpack', 'Awaitable', 'Self', 'reveal_type', 'SupportsAbs', 'ParamSpecKwargs', 'Text', 'MutableSet', 'AsyncGenerator', 'SupportsIndex', 'Type', 'TypeIs', 'Literal', 'Mapping', 'TypedDict', 'Union', 'Counter', 'Pattern', 'Protocol', 'Iterator', 'DefaultDict', 'ClassVar', 'ParamSpecArgs', 'MutableMapping', 'SupportsRound', 'get_origin', 'TypeVarTuple', 'assert_never', 'ValuesView', 'List', 'is_typeddict', 'Iterable', 'Match', 'Concatenate', 'SupportsFloat', 'runtime_checkable', 'Tuple', 'TypeGuard', 'TextIO', 'no_type_check', 'get_type_hints', 'override', 'Final', 'NewType', 'AsyncIterable', 'ForwardRef', 'ContextManager', 'TypeAliasType', 'Reversible', 'Callable', 'Generic', 'FrozenSet', 'Never', 'SupportsInt', 'assert_type'}

Activity

  1. JelleZijlstra commented on Oct 22, 2024

    @JelleZijlstra
    Member

    Looks like it's because the new typing.evaluate_forward_ref is not in typing_extensions. PR welcome to add it.

  2. changed the title [-][HEADS UP] test_drop_in_for_typing AssertionError with Python 3.14.0a1[/-] [+]Add typing_extensions.evaluate_forward_ref[/+] on Oct 22, 2024
  3. hroncok commented on Oct 29, 2024

    @hroncok
    Contributor

    For reference, this was added to Python via python/cpython#119891

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions