Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-export names from psycopg3.types #44

Merged
merged 1 commit into from
Apr 12, 2021
Merged

Conversation

dlax
Copy link
Contributor

@dlax dlax commented Apr 7, 2021

This is useful to silent mypy errors when implicit reexport is disabled
(e.g. in strict mode) like:

error: Module 'psycopg3.types' does not explicitly export attribute
'Jsonb'; implicit reexport disabled  [attr-defined]

https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-no-implicit-reexport

Accordingly, we import Int4 from psycopg3.types directly in
test_copy.py.

@dvarrazzo
Copy link
Member

Aww, that's so cumbersome to maintain... But I don't see other options here, right?

@dlax
Copy link
Contributor Author

dlax commented Apr 7, 2021 via email

@dvarrazzo
Copy link
Member

I was thinking about that. It' still quite the duplication but at least it's local and there is not a long unstructured list at the bottom of the file.

This is useful to silent mypy errors when implicit reexport is disabled
(e.g. in strict mode) like:

    error: Module 'psycopg3.types' does not explicitly export attribute
    'Jsonb'; implicit reexport disabled  [attr-defined]

https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-no-implicit-reexport

Accordingly, we import Int4 from psycopg3.types directly in
test_copy.py.
@dlax dlax force-pushed the types-reexport branch from 5cf88c5 to 45db720 Compare April 8, 2021 13:59
@dlax
Copy link
Contributor Author

dlax commented Apr 8, 2021

Ok; changed to import X as X.

Also, there's an open question at python/mypy#10198 for that "issue".

@dvarrazzo
Copy link
Member

Yes, redundant but I feel better about the more localised duplication. Thank you: will merge!

@dvarrazzo dvarrazzo merged commit 45db720 into psycopg:master Apr 12, 2021
@dlax dlax deleted the types-reexport branch April 13, 2021 08:11
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