Is there a way to automatically bind to self
(some of) the arguments of the __init__
method?
For example, suppose we have:
class Person:
def __init__(self, name, age, address):
self.name = name
self.age = age
self.address = address
...
could a lazy_init
decorator be created that allows doing it this way instead?
class Person:
@lazy_init
def __init__(self, name, age, address):
...
Does any similar technique exist? Or is there a good reason not to try?