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

Fix error on importing Events in python3.11 #2907

Conversation

sadra-barikbin
Copy link
Collaborator

Fixes #2904

@github-actions github-actions bot added the module: engine Engine module label Apr 1, 2023
@vfdev-5 vfdev-5 marked this pull request as draft April 6, 2023 17:11
obj._value_ = value
return obj

def __repr__(self) -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

@sadra-barikbin is this really necesary ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

__repr__ wasn't necessary. I removed it. But __new__ is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@vfdev-5 , from #2997 turns out it was necessary. Shall I add it as a follow-up or we should ask 3.11 users to update to 3.11.4?

vfdev-5 and others added 3 commits April 12, 2023 12:14
@vfdev-5 vfdev-5 marked this pull request as ready for review April 13, 2023 05:37
@vfdev-5
Copy link
Collaborator

vfdev-5 commented Apr 14, 2023

Thanks @sadra-barikbin !

From a discussion on discord:

As of python3.11's next release we could remove new from EventEnum, python/cpython#103479

@vfdev-5 vfdev-5 merged commit 95d3a38 into pytorch:master Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: engine Engine module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with Enum on Python3.11
2 participants