Re: [Python-ideas] Add optional defaults to namedtuple

2016-12-01 Thread Jelle Zijlstra
2016-11-30 8:11 GMT-08:00 Guido van Rossum : > On Wed, Nov 30, 2016 at 7:09 AM, Ethan Furman wrote: > >> On 11/30/2016 02:32 AM, Jelte Fennema wrote: >> >> It would be nice to have a supported way to add defaults to namedtuple, >>> so the slightly hacky

Re: [Python-ideas] Add optional defaults to namedtuple

2016-11-30 Thread Joao S. O. Bueno
On 30 November 2016 at 13:09, Ethan Furman wrote: > But even more readable than that is using the NamedTuple class from my aenum > [3] library (and on SO as [3]): > > --> from aenum import NamedTuple > --> class Node(NamedTuple): > --> val = 0 > --> left = 1, 'previous

Re: [Python-ideas] Add optional defaults to namedtuple

2016-11-30 Thread Guido van Rossum
On Wed, Nov 30, 2016 at 7:09 AM, Ethan Furman wrote: > On 11/30/2016 02:32 AM, Jelte Fennema wrote: > > It would be nice to have a supported way to add defaults to namedtuple, >> so the slightly hacky solution here does not have to be used: >>

Re: [Python-ideas] Add optional defaults to namedtuple

2016-11-30 Thread Ethan Furman
On 11/30/2016 02:32 AM, Jelte Fennema wrote: It would be nice to have a supported way to add defaults to namedtuple, so the slightly hacky solution here does not have to be used: http://stackoverflow.com/a/18348004/2570866 Actually, the solution right below it is better [1]: --> from

[Python-ideas] Add optional defaults to namedtuple

2016-11-30 Thread Jelte Fennema
It would be nice to have a supported way to add defaults to namedtuple, so the slightly hacky solution here does not have to be used: http://stackoverflow.com/a/18348004/2570866 Jelte ___ Python-ideas mailing list Python-ideas@python.org