Hey folks,

Wanted to send along one more update about this topic. Steve Orr pointed out
in a comment on Ricardo's new recipe that there's yet another way to get
named attribute access to cursor results.

The secret sauce is namedtuple, "high performance" collection type.  This
appears to be the "canonical" approach these days:

http://code.activestate.com/recipes/500261/

The Python Docs have a nice little example of this approach, using both the
csv and sqlite3 modules:

http://docs.python.org/library/collections.html#namedtuple-factory-function-for-tuples-with-named-fields

And you can check out Steve's comment at the bottom of Ricardo's recipe:

http://code.activestate.com/recipes/577186-accessing-cursors-by-field-name/

Regards,

Serdar
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to