31 Jan
2013
31 Jan
'13
9:35 a.m.
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?