[Python-ideas] Definition Symmetry

Jason Keene jasonkeene at gmail.com
Thu Jan 31 17:43:19 CET 2013


Just to be clear, I wasn't suggesting forcing parens for class
definitions.  Rather make them optional for functions!


On Thu, Jan 31, 2013 at 11:35 AM, Jason Keene <jasonkeene at gmail.com> wrote:

> Why do function definitions require parens?
>
> >>> class MyClass:
> ...     pass
> ...
> >>> def my_func:
>   File "<stdin>", line 1
>     def my_func:
>                ^
> SyntaxError: invalid syntax
>
> This seems to me to break a symmetry with class definitions.  I assume
> this is just a hold off from C, perhaps there is a non-historical reason
> tho.
>
> I believe in the past we've forced parens in list comprehensions to create
> a symmetry between comprehensions/generator expressions.  Why not for this?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130131/f26cf4a0/attachment.html>


More information about the Python-ideas mailing list