mypy: Fix fallout of ignore-without-code
Fix fallout of mypy --enable-error-code=ignore-without-code check. The multi_key_dict class had several type issues: the keys() and values() methods could implicitly return None when a key type was specified but not found, pyright flagged the conditional items() redefinition, and six test call sites carried bare "# type: ignore" comments. Add from __future__ import annotations, a _keys_from_dict() helper, and proper parameter/return type annotations to keys(), values(), and items(). Consolidate the conditional Python 2/3 items() into a single function with runtime dispatch. Remove all six bare type-ignores from multi_key_dict.py and annotate the remaining pre-existing ones in other files with specific error codes required by ignore-without-code. Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.82.0 Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
0e660dc58b
commit
241aa79120
1 changed files with 41 additions and 35 deletions
|
|
@ -106,7 +106,7 @@ class Connection: # export
|
|||
except Exception:
|
||||
# mypy says: E: "Config" has no attribute "uri" [attr-defined]
|
||||
# FIXME: Who adds .uri?
|
||||
uri = c.uri # type: ignore
|
||||
uri = c.uri # type: ignore[attr-defined]
|
||||
try:
|
||||
ret = ldap.initialize(uri)
|
||||
ret.start_tls_s()
|
||||
|
|
|
|||
Loading…
Reference in a new issue