Re: [Python-Dev] isinstance() on old-style classes in Py 2.7

2014-10-21 Thread Barry Warsaw
On Oct 21, 2014, at 11:22 AM, Guido van Rossum wrote: >Hm. I've never been a fan of that. EIBTI and such... Yeah, I just hate seeing `class Foo(object)` in Python 3 and am too lazy to clean up every class definition. ;) YMMV! Cheers, -Barry signature.asc Description: PGP signature ___

Re: [Python-Dev] isinstance() on old-style classes in Py 2.7

2014-10-21 Thread Guido van Rossum
Hm. I've never been a fan of that. EIBTI and such... On Tue, Oct 21, 2014 at 10:53 AM, Barry Warsaw wrote: > On Oct 21, 2014, at 10:13 AM, Guido van Rossum wrote: > > >For new code, and whenever you have an opportunity to refactor old code, > >you should use new-style classes, by inheriting your

Re: [Python-Dev] isinstance() on old-style classes in Py 2.7

2014-10-21 Thread Barry Warsaw
On Oct 21, 2014, at 10:13 AM, Guido van Rossum wrote: >For new code, and whenever you have an opportunity to refactor old code, >you should use new-style classes, by inheriting your class from object (or >from another class that inherits from object). One nice way to do this module-globally is to

Re: [Python-Dev] isinstance() on old-style classes in Py 2.7

2014-10-21 Thread Mark Shannon
Hi, The problem is a side effect of the fact that old-style classes are implemented on top of new-style meta-classes. Consequently although C is the "class" of C() it is not its "type". >>> type(C()) >>> type(C()).__mro__ (, ) therefore >>> issubclass(type(C()), object) True which implies >

Re: [Python-Dev] isinstance() on old-style classes in Py 2.7

2014-10-21 Thread Guido van Rossum
This is one of the unfortunate effects of the existence of "old-style" classes in Python 2. The old-style class hierarchy is distinct from the new-style class hierarchy, but instances of old-style classes are still objects (since in Python, *everything* is an object). For new code, and whenever yo