Why new Python 2.5 feature "class C()" return old-style class ?
Aahz
aahz at pythoncraft.com
Tue Apr 11 10:17:07 EDT 2006
In article <1144763219.936992.219110 at g10g2000cwb.googlegroups.com>,
<bearophileHUGS at lycos.com> wrote:
>
>In Python 3.0 I really hope the
>
>class C: pass
>class C(): pass
>class C(object): pass
>
>will mean the same thing.
The BDFL made that one of the very first Pronouncements of 3.0. ;-)
>(So in Python 2.5 the second version can be made to mean the same thing
>of the third).
Can, yes. But should it? The whole point of adding the () option to
classes was to ease the learning process for newbies who don't
understand why classes have a different syntax from functions. Having
class C(): pass
behave differently from
class C: pass
would be of no benefit for that purpose.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"LL YR VWL R BLNG T S"
More information about the Python-list
mailing list