Sorry I posted a bit fast, my two example above should read:
class Foo:
def __init__(self, bar=42, baz=None):
self.bar = bar
self.baz = baz
#
def do_something(self, bar_override=None, baz_override=None)
...
And the second one:
class Missing:
pass
MISSING = Missing()
class Foo:
...
def do_something(self, bar_override=MISSING, baz_override=MISSING)
...
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/KOXH6SCYWNQ4GHADFQDPFXI6STSOEVRQ/
Code of Conduct: http://python.org/psf/codeofconduct/