[ACCEPTED]-In python, super() is always called first in a method. Are there situations where it should be called later?-super

Accepted answer
Score: 50

Sometimes you need to validate the arguments 4 before calling super():

class UpperBase(Base):
    def __init__(self, name):
        if not name_valid(name):
            raise ValueError()
        super(UpperBase, self).__init__(name)

I don't see why this wouldn't 3 be pythonic, because it's the easiest way 2 to do it and it's straightforward. Also, read 1 @JHSaunders' comment, he makes a good point.

More Related questions