[Python-Dev] Impact of Namedtuple on startup time (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Mon Jul 17 18:27:21 EDT 2017
- Previous message (by thread): [Python-Dev] Impact of Namedtuple on startup time
- Next message (by thread): [Python-Dev] Impact of Namedtuple on startup time
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Barry Warsaw wrote:
namedtuple is great and clever, but it’s also a bit clunky. It has a weird signature and requires a made up type name.
Maybe a metaclass could be used to make something like this possible:
class Foo(NamedTuple, fields = 'x,y,z'):
...
Then the name is explicit and you get to add methods etc. if you want.
-- Greg
- Previous message (by thread): [Python-Dev] Impact of Namedtuple on startup time
- Next message (by thread): [Python-Dev] Impact of Namedtuple on startup time
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]