Questions to the FAQ

John Lenton jlenton at gmail.com
Wed Jul 14 19:56:33 EDT 2004


On Wed, 14 Jul 2004 16:41:30 -0700, Scott David Daniels
<scott.daniels at acm.org> wrote:
> 
> You can't have a new-style class inherit from a classic class, nor can
> you have a new-style inherit from a classic class.  So, the "style" of
> a class (classic or new-style) that inherits from some other class is
> inherited.

I'm just nitpicking, I know, but I think this isn't exact: you can
have a new-style inherit from a classic class:

Python 2.3.4 (#2, Jul  5 2004, 09:15:05)
[GCC 3.3.4 (Debian 1:3.3.4-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class Old: pass
...
>>> class New(object): pass
...
>>> class Mix(New, Old): pass
...
>>> type(Mix)
<type 'type'>
>>> type(New)
<type 'type'>
>>> type(Old)
<type 'classobj'>


-- 
John Lenton (jlenton at gmail.com) -- Random fortune:
bash: fortune: command not found



More information about the Python-list mailing list