Re: [sqlalchemy] Named tuples in SQLAlchemy

2012-11-10 Thread Christoph Zwerschke
Am 09.11.2012 23:54, schrieb Michael Bayer: NamedTuple is a tough one - because with our result sets we need to create a new NamedTuple for every call to execute(), meaning it has to be performant not just on creating new instances of the tuple, but on creating new tuple types as well. If

[sqlalchemy] Named tuples in SQLAlchemy

2012-11-09 Thread Christoph Zwerschke
Query results in SQLAlchemy are returned as named tuples, but SQLAlchemy uses its own flavor of named tuples which is not fully compatible with collections.namedtuple in the standard lib. For instance, _fields is called _labels in SQLAlchemy, and the method _asdict() which could be helpful

Re: [sqlalchemy] Named tuples in SQLAlchemy

2012-11-09 Thread Michael Bayer
results in SQLAlchemy are returned as named tuples, but SQLAlchemy uses its own flavor of named tuples which is not fully compatible with collections.namedtuple in the standard lib. For instance, _fields is called _labels in SQLAlchemy, and the method _asdict() which could be helpful to convert