[Python-Dev] Requesting that a class be a new-style class

Brett C. bac at OCF.Berkeley.EDU
Sat Mar 5 07:49:38 CET 2005

Guido van Rossum wrote:
>>>This is something I've typed way too many times:
>>>Py> class C():
>>>   File "<stdin>", line 1
>>>     class C():
>>>             ^
>>>SyntaxError: invalid syntax
>>>It's the asymmetry with functions that gets to me - defining a
>>>function with no arguments still requires parentheses in the
>>>definition statement, but defining a class with no bases requires the
>>>parentheses to be omitted.
> It's fine to fix this in 2.5. I guess I can add this to my list of
> early oopsies -- although to the very bottom. :-)
> It's *not* fine to make C() mean C(object). (We already have enough
> other ways to declaring new-style classes.)

OK, this is now in thanks to the following revisions:

Checking in Grammar/Grammar;
/cvsroot/python/python/dist/src/Grammar/Grammar,v  <--  Grammar
new revision: 1.53; previous revision: 1.52
Checking in Python/graminit.c;
/cvsroot/python/python/dist/src/Python/graminit.c,v  <--  graminit.c
new revision: 2.39; previous revision: 2.38
Checking in Python/compile.c;
/cvsroot/python/python/dist/src/Python/compile.c,v  <--  compile.c
new revision: 2.349; previous revision: 2.348
Checking in Misc/NEWS;
/cvsroot/python/python/dist/src/Misc/NEWS,v  <--  NEWS
new revision: 1.1267; previous revision: 1.1266


More information about the Python-Dev mailing list