gjhiggins/rdflib — Issue #51: graph.query should return collections.namedtuple
Author: gjhiggins
Created: 2011-10-19 01:06:31+00:00
State: open

Originally filed by drewpca on 2009-03-24T00:09:05

graph.query returns a sequence of tuples, but for almost no cost, and full
backward compatibility, they could be collections.namedtuple objects instead.

Then we can write code like this:

for row in graph.query("SELECT ?huge ?list ?of ?vars ..."):
print row.huge, row.vars
print repr(row) # nicer than before

I would expect unbound variables to still be in the tuple, as they are now.