Message300872
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. |
|
Date |
User |
Action |
Args |
2017-08-26 11:44:04 | steven.daprano | set | recipients:
+ steven.daprano, veky, gone |
2017-08-26 11:44:04 | steven.daprano | set | messageid: <1503747844.1.0.103780316483.issue31283@psf.upfronthosting.co.za> |
2017-08-26 11:44:04 | steven.daprano | link | issue31283 messages |
2017-08-26 11:44:03 | steven.daprano | create | |
|