-
-
Notifications
You must be signed in to change notification settings - Fork 699
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
Decorate Pack as dataclass #3215
Conversation
c4eec7c
to
c597abe
Compare
Decorating Pack as a dataclass attempts to overrides the default
|
fdbe377
to
e380768
Compare
It's gonna be so satisfying to rip out all this backwards compatibility code once we no longer support Toga < 0.5 and Python 3.9. |
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 - a fairly minor set of changes at the end of the day. Jeez, why did it take over 12 months to complete such a small PR? 😝 🤣
And yes, the "FINALLY WE GET TO DEPRECATE 3.X" purge is always really satisfying.
I think that was your final blocker for a Toga 0.5 release? Have I missed anything? |
Oh, you 🤣
That should finally be it! Let 'er rip! |
With the aliases all defined as class attribute descriptors as of #3213, Pack can be successfully decorated as a dataclass.
The only test that fails-as-is is
test_mixin.py::test_constructor
, because the auto-genereated dataclass__init__
throws aTypeError
rather than aNameError
when an erroneous property name is provided. I've changed what the test looks for, and also added atry
/except
toBaseStyle
's fallback__init__
so that the same error is generated under Python 3.9.Edit: Huh. What are the odds, it's been exactly one year, to the day, since I started this with beeware/travertino#141. I definitely didn't anticipate how long that would take 😄
PR Checklist: