Re:Making Python's __init__ method magical
by thom_nic on Friday January 03, 2014 @10:59AM
(#7006042)
I had a different take on this - it's somewhat inspired by collections.namedtuple but mutable and has some other convenient features for data classes: https://gist.github.com/tomstrummer/8240282
(see the examples at the bottom of the file)
This could also be tweaked to use __dict__ instead of __slots__ so it can act as an expando class which I believe is more similar to what the OP achieves.
(see the examples at the bottom of the file)
This could also be tweaked to use __dict__ instead of __slots__ so it can act as an expando class which I believe is more similar to what the OP achieves.