[Python-ideas] Definition Symmetry

Jason Keene jasonkeene at gmail.com
Fri Feb 1 03:13:32 CET 2013


In a way they do the same thing, they both create an object
(function/class) from a suite and assign it to the name given after the
keyword (def/class).  Sure they do totally different things with the suite
in creating the object, but in essence it's a name assignment.

On Thursday, January 31, 2013, Steven D'Aprano wrote:

> On 01/02/13 03:35, Jason Keene 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.
>>
>
> Why do you think that class definitions and function definitions
> should be symmetrical?
>
>
>
> --
> Steven
> ______________________________**_________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/**mailman/listinfo/python-ideas<http://mail.python.org/mailman/listinfo/python-ideas>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130131/73bb827b/attachment.html>


More information about the Python-ideas mailing list