[Python-ideas] SQL-like way to manipulate Python data structures
Scott Dial
scott+python-ideas at scottdial.com
Wed May 30 00:38:56 CEST 2007
Steve Howell wrote:
> Presumbably most people who use SQL databases
> already have to understand the syntax anyway. And
> those that don't can simply ignore it.
That simply will never be true. If there is new syntax added to Python,
than the burden is on everyone to understand other people's code that
uses such a feature. I'm very familiar with SQL and I am still not
convinced that I want to see it in my Python. First of all, the concept
of a relational table is ill-defined.
I gather from your code that you believe this to be a list containing
dictionaries, but why could this not be a tuple of tuples? For that
matter, any iterable of iterables? Or how about using tuple'd indices,
and so on.. It would be impossible to graft the SQL language onto all of
the variations on the idea of a "table" in Python.
Python does not have a relational table data structure, thus there
cannot be a relational language used to address such a structure. It
would not be wise to create a syntax that relies on a particular
composition of data structures.
--
Scott Dial
scott at scottdial.com
scodial at cs.indiana.edu
More information about the Python-ideas
mailing list