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

Type hints and mypy support? #977

Open
fgimian opened this issue Sep 25, 2019 · 7 comments
Open

Type hints and mypy support? #977

fgimian opened this issue Sep 25, 2019 · 7 comments

Comments

@fgimian
Copy link

fgimian commented Sep 25, 2019

Hey there guys, hope you're doing well! 😄

Are there any plans to add typing information and support mypy in the future?

Kindest Regards
Fotis

@dvarrazzo
Copy link
Member

It would be lovely! Would you like to work on it?

@fgimian
Copy link
Author

fgimian commented Sep 25, 2019

It would be lovely! Would you like to work on it?

I may give it a try soon, we're currently integrating typing into our projects so I'm still getting my head around various aspects.

The main concern would probably be Python 2.7 compatibility as it would be preferred to have the types inline with the code but I'm pretty sure Python 2.7 won't like that.

Peraps if the next major version is Python 3.x compatible only, that will make it a lot easier 😄

Thanks a lot for the reply 😄
Fotis

@ltworf
Copy link

ltworf commented Sep 25, 2019

You can create separate pyi files to give to mypy if you don't want to inline in the code.

@septatrix
Copy link

Are there any plans yet to drop support for Python 2 in e.g. psycopg3 as I would welcome that change

@dvarrazzo
Copy link
Member

Psycopg3 is Python >= 3.6 only, and it's being developed at mypy --strict already. There is a writeup here.

@bersace
Copy link

bersace commented Apr 13, 2021

Does anyone have some type stubs for psycopg2 ? I'm new to pyright and I have error: "DatabaseError" is unknown import symbol all the way around. It looks like pyright doesn't find some types hints.

@doublethink13
Copy link

Maybe this types package is relevant to someone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants