Message299643
[R David Murray]
> So I vote -0.5.
Put me down for a full -1:
* This would be a potentially confusing addition to the API.
* It may also encourage bad practices that we don't want to see in real code.
* We want to be able to search for the namedtuple definition, want to have a meaningful repr, and want pickling to be easy.
* This doesn't have to be shoe-horned into the namedtuple API. If an actual need did arise, it is trivial to write a wrapper that specifies whatever auto-naming logic happens to make sense for a particular application:
>>> from collections import namedtuple
>>> def auto_namedtuple(*attrnames, **kwargs):
typename = '_'.join(attrnames)
return namedtuple(typename, attrnames, **kwargs)
>>> NT = auto_namedtuple('name', 'rank', 'serial')
>>> print(NT.__doc__)
name_rank_serial(name, rank, serial) |
|
Date |
User |
Action |
Args |
2017-08-02 05:12:44 | rhettinger | set | recipients:
+ rhettinger, steven.daprano, r.david.murray, methane, ethan.furman, Isaac Morland |
2017-08-02 05:12:44 | rhettinger | set | messageid: <1501650764.57.0.216651395125.issue31085@psf.upfronthosting.co.za> |
2017-08-02 05:12:44 | rhettinger | link | issue31085 messages |
2017-08-02 05:12:44 | rhettinger | create | |
|