This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients gone, steven.daprano, veky
Date 2017-08-26.11:44:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1503747844.1.0.103780316483.issue31283@psf.upfronthosting.co.za>
In-reply-to
Content
I don't think this is a bug, I think it is standard behaviour which should be expected if you think about Python's execution model. If you inherit from object implicitly:

    class Spam: ...

then the interpreter gets to pick the base class, and it uses the genuine, builtin object base class. There's no name lookup, it is all built into the guts of the interpreter.

But if you specify the name of a base class:

    class Spam(foo): ...

then foo is looked up at runtime, regardless of whether you type "foo" or "int" or "str" or "object". If you have replaced or shadowed the builtin object with your own class, then you'll get *that* as the base for Spam, not the real built-in object base class.
History
Date User Action Args
2017-08-26 11:44:04steven.dapranosetrecipients: + steven.daprano, veky, gone
2017-08-26 11:44:04steven.dapranosetmessageid: <1503747844.1.0.103780316483.issue31283@psf.upfronthosting.co.za>
2017-08-26 11:44:04steven.dapranolinkissue31283 messages
2017-08-26 11:44:03steven.dapranocreate