Conversation
euresti
left a comment
There was a problem hiding this comment.
I only looked at the type stuff and made some suggestions. Though I wonder if the typevars I'm suggesting are more trouble than they're worth.
Signed-off-by: Hynek Schlawack <hs@ox.cx>
DISABLE sounds less purposeful and doesn't convey its meaning as well.
|
Since there was no more feedback, I'm YOLO-timeouting this. If someone wants to chime in before the release feel free. |
|
P.S. @euresti I took the liberty to relax |
|
Hi @hynek, I wonder if we have any release plan for this fix? We're having some use-cases which requires this and we're eagerly looking for it to be released. If anything we can help to make it release sooner, can you let us know? |
|
#666 is the last remaining part of the puzzle. I hope I’ll be able to release this week. |
|
Sounds great, thanks so much @hynek |
This fixes #645 and a billion other issues that asked for freezing attributes and validation on assignment.
I'm not married to all the names and open to better suggestions.
Yes, it was more work to integrate than anticipated. 😳
While working on this I've also noticed that we take no precaution about
__setattr__being inherited, which means that if you subclass a frozen class, you can't easily thaw it. This topic is somewhat related to this PR too but I didn't want to bloat it any further. It goes down to setting__setattr__toobject.__setattr__if we don't write an own, but ifauto_detectis true, only if the user didn't write one?