FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Use the exact type name in Record.__repr__ by jparise · Pull Request #959 · MagicStack/asyncpg · GitHub

Use the exact type name in Record.__repr__ - #959

Merged
elprans merged 1 commit into
MagicStack:masterfrom
jparise:record-repr
Oct 11, 2022
Merged

Use the exact type name in Record.__repr__#959
elprans merged 1 commit into
MagicStack:masterfrom
jparise:record-repr

Conversation

jparise commented Oct 4, 2022
edited
Loading

Copy link
Copy Markdown
Contributor

We support Record subclasses, so include the exact type name
(rather than just 'Record') in the repr() string.

Comment thread asyncpg/protocol/record/recordobj.c Outdated
writer.min_length = 12; /* <Record a=1> */

if (_PyUnicodeWriter_WriteASCIIString(&writer, "<Record ", 8) < 0) {
type_prefix = PyUnicode_FromFormat("<%s ", _PyType_Name(Py_TYPE(v)));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Building an intermediate string object here felt nicer than performing three individual _PyUnicodeWriter_ write operations.

jparise commented Oct 4, 2022
edited
Loading

Copy link
Copy Markdown
Contributor Author

Perhaps _PyType_Name wasn't available in Python 3.6?

jparise commented Oct 4, 2022

Copy link
Copy Markdown
Contributor Author

Perhaps _PyType_Name wasn't available in Python 3.6?

I provided an implementation of _PyType_Name for Python 3.6. This won't be necessary once support for Python 3.6 is dropped (#940).

elprans commented Oct 11, 2022

Copy link
Copy Markdown
Member

I think it's time to pull the plug on 3.6 and merge #940.

Comment thread asyncpg/protocol/record/recordobj.c Outdated
We support Record subclasses, so include the exact type name (rather
than just 'Record') in the repr() string.
elprans merged commit eccdf61 into MagicStack:master Oct 11, 2022
jparise deleted the record-repr branch October 11, 2022 22:36
elprans added a commit that referenced this pull request Oct 26, 2022
Support Python 3.11 and PostgreSQL 15.  This release also drops support
for Python 3.6.

Changes
=======

* Add arm64 mac and linux wheels
  (by @ddelange in 7bd6c49 for #954)

* Add Python 3.11 to the test matrix
  (by @elprans in 5f908e6 for #948)

* Exclude .venv from flake8 (#958)
  (by @jparise in 40b16ea for #958)

* Upgrade to flake8 5.0.4 (from 3.9.2) (#961)
  (by @jparise in 0e73fec for #961)

* Show an example of a custom Record class (#960)
  (by @jparise in 84c99bf for #960)

* Use the exact type name in Record.__repr__ (#959)
  (by @jparise in eccdf61 for #959)

* Drop Python 3.6 support (#940)
  (by @bryanforbes in bb0cb39 for #940)

* Test on Python 3.11 and PostgreSQL 15, fix workflow deprecations (#968)
  (by @elprans in eab7fdf for #968)
elprans mentioned this pull request Oct 26, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL