Re: A couple questions about classes and inheritance

2010-05-17 Thread Terry Reedy
On 5/16/2010 10:52 PM, Mark Young wrote: You can't subclass Ellipsis. You clipped what I believe you were responding to that I posted: "I believe that in 3.1, the builtin classes with builtin names can be subclassed and and those without cannot. (If you find any exceptionss, please post ;-).

Re: A couple questions about classes and inheritance

2010-05-16 Thread Mark Young
You can't subclass Ellipsis. -- http://mail.python.org/mailman/listinfo/python-list

Re: A couple questions about classes and inheritance

2010-05-16 Thread Terry Reedy
On 5/16/2010 6:58 PM, Paul LaFollette wrote: Anyway, again can you point me to somewhere that I can learn more? In particular, is there a list somewhere of the builtin types that are not subclassable? I believe that in 3.1, the builtin classes with builtin names can be subclassed and and tho

Re: A couple questions about classes and inheritance

2010-05-16 Thread Carl Banks
On May 16, 4:17 pm, Christian Heimes wrote: > > First, I've looked a fair bit and can't find how one can find the base > > classes of a subclass?  isinstance and issubclass sort of do the > > opposite of what I want.  Surely somewhere there is something like > > > MyThingee.something.orOther.baseC

Re: A couple questions about classes and inheritance

2010-05-16 Thread Steven D'Aprano
On Sun, 16 May 2010 18:58:45 -0400, Paul LaFollette wrote: > First, I've looked a fair bit and can't find how one can find the base > classes of a subclass? subclass.__base__ subclass.__bases__ subclass.__mro__ (The third one stands for "Method Resolution Order".) See also the inspect module.

Re: A couple questions about classes and inheritance

2010-05-16 Thread Christian Heimes
First, I've looked a fair bit and can't find how one can find the base classes of a subclass? isinstance and issubclass sort of do the opposite of what I want. Surely somewhere there is something like MyThingee.something.orOther.baseClasses() You can get the direct parents of a class with the

A couple questions about classes and inheritance

2010-05-16 Thread Paul LaFollette
Kind people, Using Python 3.1 I have been poking around trying to get more insight into Python's innards, and I have a couple of (marginally) related questions. First, I've looked a fair bit and can't find how one can find the base classes of a subclass? isinstance and issubclass sort of do the