Skip to content

Add a new row type#970

Closed
Changaco wants to merge 3 commits intopsycopg:masterfrom
Changaco:versatile-row-type
Closed

Add a new row type#970
Changaco wants to merge 3 commits intopsycopg:masterfrom
Changaco:versatile-row-type

Conversation

@Changaco
Copy link
Copy Markdown
Contributor

This branch introduces a new row type: HybridRow. Unlike the other types, hybrid rows support both item and attribute lookups and assignments; and unlike namedtuples, hybrid rows are mutable and they're all instances of a single class.

@dvarrazzo
Copy link
Copy Markdown
Member

Hi,

I am not really interested in adding an editable tuple type in the adapter.

If you want to champion such object please open a discussion in the mailing list.

@dvarrazzo dvarrazzo closed this Sep 23, 2019
@Changaco
Copy link
Copy Markdown
Contributor Author

No, I'm not going to join your mailing list. I opened a discussion by opening this PR, you chose to close that discussion. The obvious conclusion is that you probably have no intention of ever merging this branch.

Since the hybrid row type isn't wanted here I'll put it in postgres.py instead.

@dvarrazzo
Copy link
Copy Markdown
Member

This is a bug tracker, pretty much only under my eyes. New ideas ought to be discussed if they want to be included into an industry-standard project, if they are pushed to be used by all the world, if they have to be maintained by others.

It's good stuff that you take responsibility for your solely designed object instead of dumping it on us without discussion, yes. Put your class wherever you want.

@Changaco
Copy link
Copy Markdown
Contributor Author

You are stalling contributions (e.g. #565) and driving away contributors by insisting that everything be discussed in your old-fashioned mailing list. It seems you don't realize that every GitHub repository is also a mailing list, which anyone who already has a GitHub account can subscribe to in two clicks. The psycopg2 repository currently has 64 watchers, it's not “pretty much only under [your] eyes”.

Who said that my code would have to be maintained by others? I would have handled the maintenance of this code.

Changaco added a commit to liberapay/postgres.py that referenced this pull request Sep 28, 2019
This branch adds an alternative to representing query results as namedtuples or dicts.

The new `Row` class supports both item and attribute lookups and assignments. Unlike namedtuples these hybrid rows are mutable, and they're all instances of a single class.

I tried to submit this upstream, but it didn't go well (<psycopg/psycopg2#970>).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants