[Python-ideas] Docstrings for namedtuple

Joao S. O. Bueno jsbueno at python.org.br
Sun Dec 16 15:06:03 CET 2012


On 16 December 2012 11:24, Eli Bendersky <eliben at gmail.com> wrote:

>
>
> This may be a good time to say that personally I always disliked
>> namedtuple's creation syntax. It is unpleasant in two respects:
>>
>> 1. You have to repeat the name
>> 2. You have to specify the fields in a space-separated string
>>
>> I wish there was an alternative of something like:
>>
>> @namedtuple
>> class Point:
>>   x = 0
>>   y = 0
>>
>>
> And to the point of Serhiy's original topic, with this syntax there would
> be no need to invent yet another non-standard way to specify things like
> docstrings.
>

While we are at it,
why nto simply:

class Point(namedtuple):
   x = 0
   y = 0

?

>
> Eli
>
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121216/0f8a339e/attachment.html>


More information about the Python-ideas mailing list