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
done
Checking in Python/graminit.c;
/cvsroot/python/python/dist/src/Python/graminit.c,v <-- graminit.c
new revision: 2.39; previous revision: 2.38
done
Checking in Python/compile.c;
/cvsroot/python/python/dist/src/Python/compile.c,v <-- compile.c
new revision: 2.349; previous revision: 2.348
done
Checking in Misc/NEWS;
/cvsroot/python/python/dist/src/Misc/NEWS,v <-- NEWS
new revision: 1.1267; previous revision: 1.1266
done
-Brett
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com