-
Notifications
You must be signed in to change notification settings - Fork 122
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
Constant generalization #294
Conversation
The MAX_REGULAR_BLOCK_SIZE_EXP constant is introduced, as DEFAULT_BLOCK_SIZE_EXP was occasionally abused as such.
One aspect that'll need addressing is whether properties derived from ACK_TIMEOUT should be recalculated. It'd make sense, but as long as I'm using the class itself as a value, I can't do that just with |
@roysjosh have you had a chance to look at this? @chrysn from my pov, we can work with this. The only thing is we'd have have to have a |
Yeah, it's probably more consistent to use instances all the way. Maybe even instantiate once per message by default; that way, a user setting it per message won't cause spooky action at global scope.
|
I agree that this is a usable solution for the problem at hand. I'm not half the python programmer @Jc2k is so I'll just smile and nod at the second paragraph :) |
I have put together a PoC of this in HA HomeKit, but haven't had time to flesh it out yet. I'm still happy with your approach @chrysn. |
This is breaking wildcard imports of the numbers, because we can't make them raise-as-deprecated when used through a wildcard import. That's a sufficiently small breakage that it should be OK for a minor release.
I'm merging this with a few new changes (as announced: Using properties, instanciating it for every message). There is a slight incompatibility in the change as the now deprecated globals are not available through wildcard imports any more, but these are sufficiently frowned upon in libraries anyway that I doubt you'd run into any trouble (and besides, it's not like there's any good reason to access them from the outside). I expect to have a release with those in rather soon, but there are several fixes I'm spooling up for this, so not Right Now. |
Release 0.4.7 is out and contains these changes. |
Possible solution for #175, see there for the moment.