alexmojaki / alexmojaki/eval_type_backport

Fails with Python 3.15

Open
#38 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
19
Forks
9
PR merge metrics
No merged PRs in 30d

Description

https://github.com/python/cpython/commit/c89f76e6c4ca9b0200d5cc8cf0a675a76de50ba8 changed the behavior of `typing._eval_type()` to always require the `type_params` argument, leading to the following test failure (and others, picking on this one for being simple):

```
[ 21s] ___________________________ test_eval_type_backport ____________________________
[ 21s]
[ 21s] def test_eval_type_backport():
[ 21s] > check_eval('int', int)
[ 21s]
[ 21s] tests/test_eval_type_backport.py:64:
[ 21s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[ 21s] tests/test_eval_type_backport.py:50: in check_eval
[ 21s] assert eval_type_backport(ref, **kwargs) == expected
[ 21s] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 21s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[ 21s]
[ 21s] value = ForwardRef('int'), globalns = None, localns = None, try_default = True
[ 21s] args = (), kwargs = {}
[ 21s]
[ 21s] def eval_type_backport( # type: ignore # allow duplicate declaration
[ 21s] value: Any,
[ 21s] globalns: dict[str, Any] | None = None,
[ 21s] localns: Mapping[str, Any] | None = None,
[ 21s] try_default: Unused = True,
[ 21s] *args: Any,
[ 21s] **kwargs: Any,
[ 21s] ) -> Any:
[ 21s] """Alias to typing._eval_type (Python 3.10+)."""
[ 21s] > return typing._eval_type(value, globalns, localns, *args, **kwargs) # type: ignore
[ 21s] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 21s] E TypeError: _eval_type() missing 1 required positional argument: 'type_params'
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.