Changeset 901 for trunk/docs


Ignore:
Timestamp:
Jan 6, 2017, 7:25:02 AM (3 years ago)
Author:
cito
Message:

Improve creation of named tuples in Python 2.6 and 3.0

Location:
trunk/docs/contents
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/contents/changelog.rst

    r900 r901  
    55------------------------------
    66- query_formatted() can now be used without parameters.
     7- The automatic renaming of columns that are invalid as field names of
     8  named tuples now works more accurately in Python 2.6 and 3.0.
    79
    810Version 5.0.3 (2016-12-10)
     
    1820  entries, but this can be changed with the set_row_factory_size() function.
    1921  In certain cases this change can notably improve the performance.
     22- The namedresult() method in the classic API now also tries to rename
     23  columns that would result in invalid field names.
    2024
    2125Version 5.0.2 (2016-09-13)
  • trunk/docs/contents/pg/query.rst

    r781 r901  
    6565with each row returned as a named tuple with proper field names.
    6666
     67Column names in the database that are not valid as field names for
     68named tuples (particularly, names starting with an underscore) are
     69automatically renamed to valid positional names.
     70
    6771Note that since PyGreSQL 5.0 this will return the values of array type
    6872columns as Python lists.
  • trunk/docs/contents/pgdb/cursor.rst

    r814 r901  
    217217Fetch all (remaining) rows of a query result, returning them as list of
    218218named tuples. The field names of the named tuple are the same as the column
    219 names of the database query as long as they are valid Python identifiers.
     219names of the database query as long as they are valid as field names for
     220named tuples, otherwise they are given positional names.
    220221
    221222Note that the cursor's :attr:`arraysize` attribute can affect the performance
Note: See TracChangeset for help on using the changeset viewer.