[Python-ideas] Re: Auto assignment of attributes

2022-04-20 Thread Joao S. O. Bueno
On Wed, Apr 20, 2022 at 12:30 PM Pablo Alcain wrote: > > Regarding the usage of a decorator to do the auto-assignment, I think that > it has an issue regarding how to select a subset of the variables that you > would be setting. In the general case, you can probably get away with > calling

[Python-ideas] Re: Auto assignment of attributes

2022-04-20 Thread Yves Duprat
Joao S. O. Bueno wrote: > There is no need for a whole new syntax for what can trivially be > accomplished by a decorator, > and a simple one, in this cases. > I for one am all for the inclusion of a decorator targeting either the > __init__ method > or the class itself to perform this binding of

[Python-ideas] Re: mro and super don't feel so pythonic

2022-04-20 Thread malmiteria
Greg Ewing writes: > Even if you do, it's still an arbitrary choice to prefer the leftmost > method, which might be what you want or might not. Yep, i 100% agree with you, and that's (one of) my problems with current MI in python, and the reason i named that thread MRO and super don't feel so

[Python-ideas] Re: Auto assignment of attributes

2022-04-20 Thread Pablo Alcain
Regarding the usage of a decorator to do the auto-assignment, I think that it has an issue regarding how to select a subset of the variables that you would be setting. In the general case, you can probably get away with calling `autoassign`. But, for example, if you want to set a but not b, you'd