[Python-ideas] namedtuple literals [Was: RE a new namedtuple]

Koos Zevenhoven k7hoven at gmail.com
Wed Jul 26 18:33:39 EDT 2017


On Wed, Jul 26, 2017 at 8:47 PM, Alexandre Brault <abrault at mapgears.com>
wrote:

>
> The main use case for ntuple literals, imo, would be to replace
> functions like this:
> >>> def spam(...):
> ...   [...]
> ...   return eggs, ham
>
> With the more convenient for the caller
> >>> def spam(...):
> ...   [...]
> ...   return (eggs=eggs, ham=ham)
>
>
​Yes, but for the caller it's just as convenient without new namedtuple
syntax.

If there's new *syntax* for returning multiple values, it would indeed
hopefully look more into the future and not create a tuple.


-- Koos


-- 
+ Koos Zevenhoven + http://twitter.com/k7hoven +
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170727/62457bdc/attachment.html>


More information about the Python-ideas mailing list