Re: Why new Python 2.5 feature "class C()" return old-style class ?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: Why new Python 2.5 feature "class C()" return old-style class ?

From: Aahz <aahz@pythoncraft.com>
Date: Tue Apr 11 2006 - 16:17:07 CEST

In article <1144763219.936992.219110@g10g2000cwb.googlegroups.com>,
 <bearophileHUGS@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@pythoncraft.com)           <*>         http://www.pythoncraft.com/
"LL YR VWL R BLNG T S"
Received on Sun Apr 30 22:50:49 2006