Skip to content

Update typing rewrite with special cases#289

Merged
asottile merged 1 commit intoasottile:mainfrom
cdce8p:typing-rewrite-special-cases
Jul 19, 2022
Merged

Update typing rewrite with special cases#289
asottile merged 1 commit intoasottile:mainfrom
cdce8p:typing-rewrite-special-cases

Conversation

@cdce8p
Copy link
Contributor

@cdce8p cdce8p commented Jul 18, 2022

Ref: asottile/pyupgrade#683

The typing_extensions readme lists a couple of special cases of objects which are available in older Python versions but don't provide the full support of new features.

Version Symbols
3.10 get_origin, get_args
3.11 NamedTuple, TypedDict, final, overload

Comment on lines +20 to +29
CUSTOM_TYPING_EXT_SYMBOLS = {
(3, 11): {'NamedTuple', 'TypedDict'},
}
Copy link
Owner

Choose a reason for hiding this comment

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

ah oh I mean I would keep the data here but just delete the 3.11 stuff from the output when copying it over (that way when 3.11 final comes out I can just rerun this)

* 3.10: get_origin, get_args
* 3.11: NamedTuple, TypedDict, final, overload
Copy link
Owner

@asottile asottile left a comment

Choose a reason for hiding this comment

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

@asottile asottile merged commit c6d5e6c into asottile:main Jul 19, 2022
@cdce8p cdce8p deleted the typing-rewrite-special-cases branch July 19, 2022 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants