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

Remove duplicate type stub #979

Merged

Commits on Nov 15, 2021

  1. Remove duplicate type stub

    `mypy` exits in an error state if the `pyodbc.pyi` file is included in a
    type checking session, because of a duplicate definition of
    `SQL_CONVERT_VARCHAR`.  This can be verified by installing `mypy` and
    running:
    
        mypy src/pyodbc.pyi
    
    This patch corrects the issue and allows the `pyodbc` usage to be
    type-checked through at least use of these methods:
    
    * `pyodbc.drivers()`
    * `pyodbc.connect(...)`
    * `pyodbc.connect(...).cursor()`
    * `pyodbc.connect(...).cursor().__enter__()` (using a `with` context)
    * `pyodbc.connect(...).cursor().__exit__()`
    * `pyodbc.connect(...).cursor().execute()`
    * `pyodbc.connect(...).cursor().fetchone()`
    
    With a note for future work: `mypy --strict` against the same stub file
    raises several errors pertaining to missing parameter types.
    
    Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
    ajnelson-nist committed Nov 15, 2021
    Configuration menu
    Copy the full SHA
    09ed322 View commit details
    Browse the repository at this point in the history