New submission from da-dada <georg.klingenb...@travedsl.de>:

from the docu I expected at the second call just a return of value and not a 
second calculation: there is room for improvement, as Elon Musk would say..

class Ddefault:

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

    def set_default(self):
        print(vars(self))
        return 'default'

if __name__ == "__main__":
    Ddefault()

----------
messages: 358016
nosy: da-dada
priority: normal
severity: normal
status: open
title: dict.setdefault (setdefault of dictionary)
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38998>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to