-
Notifications
You must be signed in to change notification settings - Fork 373
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
support python 3.11 #1103
support python 3.11 #1103
Conversation
@schroeder- any ideas what is happening here? |
I think I will jsut disable that test for now |
@@ -157,7 +157,7 @@ def get_default_value(uatype, enums=None): | |||
# We have an enum, try to initilize it correctly | |||
val = list(getattr(ua, uatype).__members__)[0] | |||
return f"ua.{uatype}.{val}" | |||
return f"ua.{uatype}()" | |||
return f"field(default_factory=ua.{uatype})" |
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.
This changes breaks the old struct code.
The problem is that the old code registers the variables to ua namespace after executing the codes in another step.
This would require some reworking of the old struct code.
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.
I do not understand that one. That change should only change the way the dataclass is initiliazed. How does it change the registratoin to the ua namespace?
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.
The old code first creates all classes and after that they are registered to the ua namespace. So if they are used in the default_factory that will fail.
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.
If you change the line back the test will pass. But the 1.04 will fail ...
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.
arrgg. OK now I remember I found out that yesterday, but then you cannot simply register because you also need to reorder dependencies and that is not done in that code... Not sure what to do. either we do not support 3.11 or we break old structure support. Or we need someone to implement that reodering because I really do not have time
You can merge and I try the change the old struct code after that. |
but currently I have 0 idea why the old code is broken |
OK. I have one absolutely horrible bypass: |
let's try that one |
I think that hack is actually the best way without reordering the whole old struct code. |
No description provided.