I often see this pattern:
class Foo: def __init__(self, bar): self._bar = bar def bar(self): return _bar
Why would that be preferable to this?
class Foo: def __init__(self, bar) self.bar = bar
Aucun commentaire:
Enregistrer un commentaire