Am 22.04.2018 um 14:01 schrieb Christoph Zwerschke:
> * Would it make sense to make the result row type configurable by
> providing get/set_result_type() methods on the module, connection and
> query level? We could then get rid of the 6 different accessor methods
> for the result result list/iter and simply call list() or iter() on
> the query (or just iterate over it, or access items directly). Not
> sure whether this is a silly or clever idea, what do you think?

To answer my own question, I think it's probably not very clever (or maybe too clever) since it introduces a temporal coupling and makes static typing difficult. (We might want to add type hints in a future, maybe Py3 only version.). So I'd rather stick with the different methods (getresults, dictresults, namedresults, dictiter and namediter) (we don't need iterresults since it will be the default __iter__ method).

But I'd like to get some feedback by others.

-- Christoph


_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to