This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author remi.lapeyre
Recipients da-dada, remi.lapeyre
Date 2019-12-08.18:55:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CA+jiYFBJnPzXRdMLRkgfONczZsaugBzbxWvawmabPaubKO+tgw@mail.gmail.com>
In-reply-to <1575830842.98.0.261556946938.issue38998@roundup.psfhosted.org>
Content
>
>
>     def __init__(self):
>         vars(self).setdefault('default', self.set_default())
>         vars(self).setdefault('default', self.set_default())
>

This code is equivalent to

    def __init__(self):
        x = self.set_default()
        vars(self).setdefault('default', x)

        x = self.set_default()
        vars(self).setdefault('default', x)

>
because the argument is evaluated before the call to setdefault() so you
can't optimise anything here.
History
Date User Action Args
2019-12-08 18:55:43remi.lapeyresetrecipients: + remi.lapeyre, da-dada
2019-12-08 18:55:43remi.lapeyrelinkissue38998 messages
2019-12-08 18:55:43remi.lapeyrecreate