Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes HfArgumentParser compatible with Python 3.9 #9479

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

Tpt
Copy link
Contributor

@Tpt Tpt commented Jan 8, 2021

Python 3.9 changed the format of the string serialization of typing.Optional.

For example, str(typing.Optional[str]) is typing.Union[str, NoneType] in python 3.8 and typing.Optional[str] in Python 3.9.

Python 3.9 changed the format of the string serialization of `typing.Optional`.
For example, `str(typing.Optional[str])` is
`typing.Union[str, NoneType]` in python 3.8 and
`typing.Optional[str]` in Python 3.9.
Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Thanks for investigating the bug and fixing it!

@julien-c
Copy link
Member

julien-c commented Jan 8, 2021

LGTM

@LysandreJik LysandreJik merged commit e34e455 into huggingface:master Jan 8, 2021
guyrosin pushed a commit to guyrosin/transformers that referenced this pull request Jan 15, 2021
Python 3.9 changed the format of the string serialization of `typing.Optional`.
For example, `str(typing.Optional[str])` is
`typing.Union[str, NoneType]` in python 3.8 and
`typing.Optional[str]` in Python 3.9.
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.

4 participants