Mark Shannon <[email protected]> added the comment:
Just to clarify.
class AlwaysShared:
opt = DEFAULT
def __init__(self, attr, optional=None):
self.attr = attr
if optional:
self.opt = optional
class SometimesShared:
opt = DEFAULT
def __init__(self, attr, optional=None):
if optional:
self.opt = optional
self.attr = attr
The class AlwaysShared always has shared keys, whereas the class
SometimesShared is not shared if `optional` is True for first instantiation,
but False for a later instantiation.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40116>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com