Christmas just came early for me. psycopg2.3, now in beta, includes named tuples as return values from queries.
If you are tired of writing result, and would much prefer to write result.column_name, you now can.
There are 2 comments.
You could always have been writing result[‘column_name’] via DictCursor, RealDictCursor, etc. Writing result was never necessary in recent memory.
True, true. The named tuple syntax is much cleaner, though.
the build is christophe pettus' software development blog. it has an rss feed. christophe is ceo of PostgreSQL Experts, Inc.