Commit bb90e8fa authored by Tim Graham's avatar Tim Graham
Browse files

[1.8.x] Fixed #25455 -- Optimized dictfetchall() example.

Thanks aklim007 for the suggestion.

Backport of 361f6047 from master
parent 66f50e97
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -282,9 +282,9 @@ using something like this::

    def dictfetchall(cursor):
        "Return all rows from a cursor as a dict"
        desc = cursor.description
        columns = [col[0] for col in cursor.description]
        return [
            dict(zip([col[0] for col in desc], row))
            dict(zip(columns, row))
            for row in cursor.fetchall()
        ]