Skip to content

Remove obsolete Literal deduplication assertion - #785

Merged
AlexWaygood merged 1 commit into
mainfrom
alex/fix-literal-unhashable-args-test
Aug 12, 2026
Merged

AlexWaygood merged 1 commit into
mainfrom
alex/fix-literal-unhashable-args-test

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

Fixes #784.

Summary

Remove the assertion that Literal[[], []].__args__ is ([], []). python/cpython#153914 deliberately changed typing.Literal to deduplicate unhashable arguments, so Python 3.14.7 now returns ([],) instead. On supported Python versions where typing_extensions.Literal aliases typing.Literal, the old assertion therefore contradicts the standard library behavior.

This PR just deletes the assertion entirely: the behaviour here is now version-dependent, and the assertion was always testing an implementation detail that wasn't really that important.

Historical context

@codecov

codecov Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.26%. Comparing base (83400e9) to head (6e18c1c).

@@            Coverage Diff             @@
##             main     #785      +/-   ##
==========================================
- Coverage   97.26%   97.26%   -0.01%     
==========================================
  Files           3        3              
  Lines        7860     7859       -1     
==========================================
- Hits         7645     7644       -1     
  Misses        215      215              
Flag Coverage Δ
3.10 88.85% <ø> (-0.01%) ⬇️
3.10.4 88.85% <ø> (-0.01%) ⬇️
3.11 88.02% <ø> (-0.01%) ⬇️
3.11.0 87.27% <ø> (-0.01%) ⬇️
3.12 87.96% <ø> (-0.01%) ⬇️
3.12.0 87.94% <ø> (-0.01%) ⬇️
3.13 83.39% <ø> (-0.01%) ⬇️
3.13.0 84.09% <ø> (-0.01%) ⬇️
3.14 79.53% <ø> (-0.01%) ⬇️
3.9 89.53% <ø> (-0.01%) ⬇️
3.9.12 89.53% <ø> (-0.01%) ⬇️
pypy3.10 88.68% <ø> (-0.01%) ⬇️
pypy3.11 87.88% <ø> (-0.01%) ⬇️
pypy3.9 89.37% <ø> (-0.01%) ��️

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.23% <ø> (-0.01%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@AlexWaygood
AlexWaygood marked this pull request as ready for review August 12, 2026 11:56

@srittau srittau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

@AlexWaygood
AlexWaygood merged commit 79c903c into main Aug 12, 2026
23 checks passed
@AlexWaygood
AlexWaygood deleted the alex/fix-literal-unhashable-args-test branch August 12, 2026 12:13
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Aug 18, 2026
…0852

https://build.opensuse.org/request/show/1370852
by user dgarcia + anag_factory
- Drop not needed patch py314-fix-tests.patch
- Add upstream patch
  remove-obsolete-literal-deduplication-assertion.patch
  (gh#python/typing_extensions#785, bsc#1274786)
- Update to 4.16.0:
  * Avoid a DeprecationWarning when deprecated is applied to a
    coroutine function on Python 3.14.0.
  * Make `typing_extensions.TypeAliasType`'s `__module__` attribute
    writable.  Backport of CPython PR [#149172](python/cpython#149172).
  * Fix setting of `__required_keys__` and `__optional_keys__` when
    inheriting keys with the same name.
  * Add support for `AsyncIterator`, `io.Reader`, `io.Writer` and
    `os.PathLike` protocols as bases for other protocols.
  * Fix incorrect behaviour on Python 3.9 and Python 3.10 that meant
    that calling `isinstance` with
    `
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants