Some "type: ignore" no longer needed, some need a different kind.
# Pure Python implementation, slow and requires the system libpq installed.
if not module and (not impl or impl == "python"):
try:
- from . import pq_ctypes as module # type: ignore[no-redef]
+ from . import pq_ctypes as module # type: ignore[assignment]
except Exception as e:
handle_error("python", e)
def dump_decimal_to_numeric_binary(obj: Decimal) -> Union[bytearray, bytes]:
sign, digits, exp = obj.as_tuple()
- if exp == "n" or exp == "N": # type: ignore[comparison-overlap]
+ if exp == "n" or exp == "N":
return NUMERIC_NAN_BIN
- elif exp == "F": # type: ignore[comparison-overlap]
+ elif exp == "F":
return NUMERIC_NINF_BIN if sign else NUMERIC_PINF_BIN
# Weights of py digits into a pg digit according to their positions.
# Requirements to run the test suite
"test": [
"anyio >= 3.6.2",
- "mypy >= 0.990",
+ "mypy >= 1.0",
"pproxy >= 2.7",
"pytest >= 6.2.5",
"pytest-cov >= 3.0",
# From the 'test' extra
anyio == 3.6.2
-mypy == 0.990
+mypy == 1.0.0
pproxy == 2.7.0
pytest == 6.2.5
pytest-cov == 3.0.0
if format == Format.TEXT:
from psycopg.types.string import StrDumper as BaseDumper
else:
- from psycopg.types.string import ( # type: ignore[no-redef]
+ from psycopg.types.string import ( # type: ignore[assignment]
StrBinaryDumper as BaseDumper,
)
if format == Format.TEXT:
from psycopg.types.string import StrDumper as BaseDumper
else:
- from psycopg.types.string import ( # type: ignore[no-redef]
+ from psycopg.types.string import ( # type: ignore[assignment]
StrBinaryDumper as BaseDumper,
)
with psycopg.ServerCursor(conn, "bar") as cur:
assert cur.name == "bar"
- assert cur.row_factory is rows.dict_row # type: ignore
+ assert cur.row_factory is rows.dict_row
with psycopg.ServerCursor(conn, "baz", row_factory=rows.namedtuple_row) as cur:
assert cur.name == "baz"
async with psycopg.AsyncServerCursor(aconn, "bar") as cur:
assert cur.name == "bar"
- assert cur.row_factory is rows.dict_row # type: ignore
+ assert cur.row_factory is rows.dict_row
async with psycopg.AsyncServerCursor(
aconn, "baz", row_factory=rows.namedtuple_row