Could someone please explain to me this strange line in configobj.py, line 1190 :
Section.__init__(self, self, 0, self)
I don't understand the meaning of this multidecaration of self.
Thank you
Could someone please explain to me this strange line in configobj.py, line 1190 :
Section.__init__(self, self, 0, self)
I don't understand the meaning of this multidecaration of self.
Thank you
Copyright © 2021 Jogjafile Inc.
Let's look at the
__init__ofSection:For some reason, the author of this code has decided to pass
selfseveral times toSection's__init__. I haven't looked at the code in detail but this usually means objects can be constructed and in other cases these arguments will vary (i.e., they won't beselfeach time).So for this particular call, the object represented by
selfplays a variety of roles and that's why the object is passed multiple times to the parent class's__init__. So to understand whyselfis passed multiple times you'll need to look at the purpose of the arguments and to see why they're the same in this case. It's conceivable that instances will be created where the arguments are different as those "roles" are then handled by different objects, and not all by the same object.