A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/oracle/python-oracledb/issues/391 below:

Proper type hint of Cursor.execute parameters · Issue #391 · oracle/python-oracledb · GitHub

Below function works fine but I get an error from Mypy saying parameters type, Optional[dict], is not compatible with Union[dict, list, tuple].

def dummy(cursor: Cursor, parameters: dict | None) -> None:
    for row in cursor.execute("select current_date from dual", parameters):
        print(row[0])

Given parameters defaults to None, I believe type hint should include None too.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4