Is there a way to automatically bind to self
(some of) the arguments of the __init__
method?
I mean something like:
class Person:
@lazy_init
def __init__(self, name, age, address):
...
... instead of:
class Person:
def __init__(self, name, age, address):
self.name = name
self.age = age
self.address = address
...
I wonder if there is something similar that people already use in such cases. Or there is any reason I'm not supposed to do it this way in the first place?