[Python-ideas] Augmented assignment syntax for objects.

tritium-list at sdamon.com tritium-list at sdamon.com
Wed Apr 26 08:02:39 EDT 2017



> -----Original Message-----
> From: Python-ideas [mailto:python-ideas-bounces+tritium-
> list=sdamon.com at python.org] On Behalf Of Oleg Broytman
> Sent: Wednesday, April 26, 2017 7:33 AM
> To: python-ideas at python.org
> Subject: Re: [Python-ideas] Augmented assignment syntax for objects.
> 
> On Wed, Apr 26, 2017 at 01:12:14PM +0200, Brice PARENT
> <contact at brice.xyz> wrote:
> >     def _set_multiple(self, **kwargs):
> >         for key, value in kwargs.items():
> >             setattr(self, key, value)
> 
>     self.__dict__.update(kwargs)

Touching __dict__ feels dirty to me.

> Oleg.
> --
>      Oleg Broytman            http://phdru.name/            phd at phdru.name
>            Programmers don't die, they just GOSUB without RETURN.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/



More information about the Python-ideas mailing list