-
Notifications
You must be signed in to change notification settings - Fork 131
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
OpType(Enum)
falls down on python 3.11.1
#615
Conversation
Op(Enum)
should fall down on python 3.11.1Op(Enum)
falls down on python 3.11.1
Op(Enum)
falls down on python 3.11.1OpType(Enum)
falls down on python 3.11.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, would be nice to add a line in CHANGELOG
See the most recent commit for the CHANGELOG |
Hey this is my 5th minute looking at PyTeal and I can't really find any places that use the specific typing information that is/was provided by NamedTuple, but I did see some places that ask for the str() representation of a NamedTuple (for example, in tealop.py) and I verified that the str() for a dataclasses looks the same as a str() for NamedTuple).
` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for catching this
Thanks for the quick investigation. You add to my confidence that this change is safe. The main usages of
All of these behaviors are remain the same under this proposed change, and all tests pass giving my high confidence. |
The Problem
There is a regression on python 3.11.1 which breaks the way we're using
NamedTuple
s as anOpType(Enum)
base type.Even though it is expected that python 3.11.2 will fix the regression, there is a simple solution: swap in a dataclass instead.
Testing
I'm also introducing python 3.11 workflows to demonstrate the problem and ensure confidence in the fix. I propose that we keep these workflows in place to help detect future regressions. Please note that the example error occurred without any code changes, i.e. all I did was introduce the python 3.11.1 workflow. You can validate with this commit: df92197