On 2018-07-08 10:47 AM, Christoph Zwerschke wrote:
> Here are some thoughts on the next steps in PyGreSQL development.
> 
> First, even though there haven't been any real changes, we should
> release a 5.0.6 version that ships with binaries for Python 3.7 and the
> proper trove classifier for the license. The problem with 5.0.5 was that
> we couldn't release it on PyPI because they introduced a slightly
> different trove classifier that prevented uploading. And 5.0.5 was
> released before Python 3.7 and not yet tested with that version.

OK by me.  I just installed 3.7 so I can do some testing.

> Second, we should start working on 5.1.0 in the trunk.

OK,

> Actually we could use attributes/properties instead of methods and
> getiter() would not be needed, as we can make the query itself iterable;
> it would then return tuples. dictiter() could become as_dicts,
> namediter() could become with_names, used like so:
> 
> for row in query:
>   print row[0], row[1]
> 
> for row in query.as_dicts:
>   print row['id'], row['name']

I wonder if we could make it act as a dict or a sequence based on
whether it got an int or a string.

> for row in query.with_names:
>   print row.id, row.name

I don't see why this at least couldn't work without "with_names".

> The old methods could become deprecated aliases:
> 
> query.getresult() = list(query)
> query.dictresult() = list(query.as_dicts)
> query.namedresult() = list(query.with_names)

Of course, this suggests that we would need the attributes in any case.
> What do you think?

Overall I am good with it.  One question - would "print(query) still
display the result in tabular form?

-- 
D'Arcy J.M. Cain
PyGreSQL Development Group
http://www.PyGreSQL.org IM:[email protected]
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to