Skip to content

Fix various things with Literal - #145

Merged
JelleZijlstra merged 4 commits into
python:mainfrom
AlexWaygood:literal-fixes
Apr 17, 2023
Merged

JelleZijlstra merged 4 commits into
python:mainfrom
AlexWaygood:literal-fixes

Conversation

@AlexWaygood

Copy link
Copy Markdown
Member

Fixes #113. Closes #144.

Backports python/cpython#23294 and python/cpython#23383, both originally by Yurii Karabas.

Comment thread CHANGELOG.md
A side effect of one of the changes is that equality comparisons of `Literal`
objects will now raise a `TypeError` if one of the `Literal` objects being
compared has a mutable parameter. (Using mutable parameters with `Literal` is
not supported by PEP 586 or by any major static type checkers.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice dig against pyanalyze :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh entirely unintentional!! I can take this out if you like :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nah, it's true.

@JelleZijlstra

Copy link
Copy Markdown
Member

Seems like something's broken on 3.9.0.

Comment thread src/test_typing_extensions.py Resolved
@AlexWaygood

Copy link
Copy Markdown
Member Author

Seems like something's broken on 3.9.0.

A result of python/cpython#19620. I'm looking at it.

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

Labels

None yet

2 participants