class Works(type):
def __new__(cls, *args, **kwargs):
print([cls,args]) # outputs [<class '__main__.Works'>, ()]
return super().__new__(cls, args)
class DoesNotWork(type):
def __new__(*args, **kwargs):
print([args[0],args[:0]]) # outputs [<class '__main__.doesNotWork'>, ()]
return super().__new__(args[0], args[:0])
Works() # is fine
DoesNotWork() # gets "RuntimeError: super(): no arguments"
As far as I can see, in both cases super._new__ receives the class literal as first argument, and an empty tuple as the 2nd.
So why does one give an error and the other not?