]> git.ipfire.org Git - thirdparty/psycopg.git/commit
Add a typing example (mypy) test
authorDenis Laxalde <denis.laxalde@dalibo.com>
Wed, 7 Apr 2021 14:57:20 +0000 (16:57 +0200)
committerDenis Laxalde <denis.laxalde@dalibo.com>
Mon, 26 Apr 2021 14:00:57 +0000 (16:00 +0200)
commit5478e96f9f712112ed49a507ce29c164939eefc7
tree539344d3e138c8074f47bb8b4fbc8a2cdbc7014d
parent0af7e6fba0f21d3577dd974272afbe8e27e582c9
Add a typing example (mypy) test

This example is checked by running mypy on it with both Python and C
implementation.

By having cursor and record values' type declared before assignment, we
make sure that expected types are consistent (otherwise mypy would raise
"Incompatible types in assignment" errors).

Example check_row_factory_connection() is still incomplete because
Connection is not generic on Row; it thus contain many Any types.
psycopg3/tox.ini
psycopg3_c/tox.ini
tests/typing_example.py [new file with mode: 0644]