On Thu, 26 Sep 2019 at 13:39, Rhodri James <rho...@kynesim.co.uk> wrote: > > On 26/09/2019 13:20, ast wrote: > > > > >>> class ClassB(object): > > ... def __new__(cls, arg): > > ... print('__new__ ' + arg) > > ... return object > > ... def __init__(self, arg): > > ... print('__init__ ' + arg) > > ... > > > > >>> o = ClassB("Hello") > > __new__ Hello <snip>
> You have returned the class object, not > an instance of anything, Well object is an instance of object as well as of type: >>> isinstance(object, object) True >>> isinstance(object, type) True >>> isinstance(type, object) True >>> isinstance(type, type) True >>> issubclass(object, type) False >>> issubclass(type, object) True >>> type.mro(type) [<class 'type'>, <class 'object'>] >>> type.mro(object) [<class 'object'>] >>> type(object) <class 'type'> >>> type(type) <class 'type'> -- Oscar -- https://mail.python.org/mailman/listinfo/python-list