typing_extensions icon indicating copy to clipboard operation
typing_extensions copied to clipboard

Expand protocol allowlist to match CPythons

Open JanEricNitschke opened this issue 4 months ago • 4 comments

Discovered by running the CPython 3.12 test_typing.py over typing_extensions.

https://github.com/JanEricNitschke/typing_extensions/actions/runs/17633620675/job/50105726688#step:7:38

Originally failing test: https://github.com/python/cpython/blob/3.12/Lib/test/test_typing.py#L4047

Current situation in 3.14: https://github.com/python/cpython/blob/3.14/Lib/test/test_typing.py#L4373

And the current allow list: https://github.com/python/cpython/blob/main/Lib/typing.py#L1894

JanEricNitschke avatar Sep 11 '25 17:09 JanEricNitschke

Thanks! Could you add a changelog entry and address the CI failures?

JelleZijlstra avatar Sep 11 '25 17:09 JelleZijlstra

With the test failure in 3.13 there is actually a decision that would have to be made that i only noticed now.

Because 3.14 added os.PathLike to the allowlist. The question would be if we want to backport that as well? Then we would have to change this to 3.14 (i would dig up the breakpoint). Or i can just leave that and remove the PathLike support for now and just include the AsyncIterator one?

But i guess it makes the most sense to also backport the os.PathLike, so ill adjust the PR unless you disagree or think this needs more discussion.

JanEricNitschke avatar Sep 11 '25 18:09 JanEricNitschke

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 97.37%. Comparing base (9215c95) to head (03426a5).

@@           Coverage Diff           @@
##             main     #676   +/-   ##
=======================================
  Coverage   97.36%   97.37%           
=======================================
  Files           3        3           
  Lines        7680     7685    +5     
=======================================
+ Hits         7478     7483    +5     
  Misses        202      202           
Flag Coverage Δ
3.10 ?
3.10.4 89.00% <100.00%> (+<0.01%) :arrow_up:
3.11.0 87.46% <100.00%> (+<0.01%) :arrow_up:
3.12 ?
3.12.0 88.17% <100.00%> (+<0.01%) :arrow_up:
3.13 83.62% <100.00%> (?)
3.13.0 83.62% <100.00%> (+1.23%) :arrow_up:
3.14 78.85% <100.00%> (+0.01%) :arrow_up:
3.9 89.71% <100.00%> (+<0.01%) :arrow_up:
3.9.12 89.71% <100.00%> (+<0.01%) :arrow_up:
pypy3.10 88.83% <100.00%> (+<0.01%) :arrow_up:
pypy3.11 88.09% <100.00%> (+<0.01%) :arrow_up:
pypy3.9 89.54% <100.00%> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/test_typing_extensions.py 98.39% <100.00%> (+<0.01%) :arrow_up:
src/typing_extensions.py 93.88% <100.00%> (ø)
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Sep 11 '25 18:09 codecov[bot]

Yes, we should backport the PathLike support to 3.14 and adjust the version check accordingly.

JelleZijlstra avatar Sep 11 '25 18:09 JelleZijlstra