![]() Super(FirstOrderSubClass, self). You can use *args and **kw to capture any additional arguments and just ignore those to make cooperative subclassing work: class BaseClass(object): Since object._init_() never does, this means you need a sentinel class that does not use super() BaseClass will do nicely here. The proper way to use super() is for all your methods to at least accept all the same arguments. Note that there is no point in assigning to self.name there if you are going to ask FirstOrderSubClass._init_ to do the exact same thing. Super(SecondOrderSubClass, self)._init_(name) ![]() See *Python's super() is considered super! by Raymond Hettinger, or it's followup P圜on presentation to explain why you want your signatures to match.Ĭalling the BaseClass._init_ unbound method directly (passing in self explicitly) would also work: class SecondOrderSubClass(FirstOrderSubClass): Double-elimination with top two advancing to the main tournament. ![]() ![]() Only players who are in South Korea are available to participate in GSL ST Qualifiers. However, your _init_ method signatures do not match so you cannot rely on cooperative behaviour here as soon as you add a mix-in class in the hierarchy, things can and probably will break. The 2021 AfreecaTV GSL Super Tournament 2 is the second Super Tournament of the ESL Pro Tour 2021/22. You cannot access nfig_array until BaseClass._init_() has run to set the attribute.Įither fix FirstOrderSubClass to also invoke the base class _init_ or call it directly.įixing the FirstOrderSubClass is probably the best way to do so: class FirstOrderSubClass(BaseClass): ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |