mypy: Fix no_untyped_defs
Add type annotations to 30 files across jw.util, resolving all 191 'no-untyped-def' mypy errors in strict mode. The changes cover Signals, CppState, Bunch, RedirectStdIO, StopWatch, Process, Options, ArgsContainer, Object, multi_key_dict, ldap, Session, rows, ShuntingYard, TableIoHandler, DataBase, Queries, Query, QueryResult, and all db/schema files (Column, Table, ColumnSet, DataType, Schema, SingleForeignKey, CompositeForeignKey), plus asyncio variants and ev/base/Object and auth/dummy/Auth. Additionally, unreachable code and type annotation conflicts were resolved in StopWatch.py, Options.py, rows.py, and Table.py. 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
73f52fb609
commit
9323529187
1 changed files with 247 additions and 220 deletions
|
|
@ -49,7 +49,7 @@ class Config:
|
|||
return self.__ldap_uri
|
||||
|
||||
@ldap_uri.setter
|
||||
def ldap_uri(self, rhs):
|
||||
def ldap_uri(self, rhs: str | None) -> None:
|
||||
self.__ldap_uri = rhs
|
||||
|
||||
@property
|
||||
|
|
@ -62,7 +62,7 @@ class Config:
|
|||
return self.__bind_dn
|
||||
|
||||
@bind_dn.setter
|
||||
def bind_dn(self, rhs):
|
||||
def bind_dn(self, rhs: str | None) -> None:
|
||||
self.__bind_dn = rhs
|
||||
|
||||
@property
|
||||
|
|
@ -87,7 +87,7 @@ class Config:
|
|||
return self.__bind_pw
|
||||
|
||||
@bind_pw.setter
|
||||
def bind_pw(self, rhs):
|
||||
def bind_pw(self, rhs: str | None) -> None:
|
||||
self.__bind_pw = rhs
|
||||
|
||||
@property
|
||||
|
|
@ -97,7 +97,7 @@ class Config:
|
|||
return self.__base_dn
|
||||
|
||||
@base_dn.setter
|
||||
def base_dn(self, rhs):
|
||||
def base_dn(self, rhs: str | None) -> None:
|
||||
self.__base_dn = rhs
|
||||
|
||||
class Connection: # export
|
||||
|
|
@ -341,9 +341,9 @@ class Connection: # export
|
|||
if self.__object_class_tree is None:
|
||||
|
||||
def collect(root: ObjectClass, attr: str) -> set[str]:
|
||||
ret = set()
|
||||
ret: set[str] = set()
|
||||
|
||||
def cb(oc, attr):
|
||||
def cb(oc: Any, attr: Any) -> None:
|
||||
vals = getattr(oc, attr)
|
||||
if vals is None:
|
||||
return
|
||||
|
|
@ -396,15 +396,17 @@ class Connection: # export
|
|||
attrs_by_origin[str(oc)] = cur
|
||||
return attrs_by_origin if origins else all_attrs
|
||||
|
||||
def is_derived_class(self, name, base_candidate):
|
||||
def is_derived_class(self, name: str, base_candidate: str) -> bool:
|
||||
#oid = self.object_class_by_name[name].oid
|
||||
#base_oid = self.object_class_by_name[base_candidate].oid
|
||||
#if base_oid in [oc.oid for oc in self.object_class_path(name)]:
|
||||
# return True
|
||||
return nx.has_path(
|
||||
self.object_class_tree,
|
||||
self.object_class_by_name[name.lower()].oid,
|
||||
self.object_class_by_name[base_candidate.lower()].oid
|
||||
return bool(
|
||||
nx.has_path(
|
||||
self.object_class_tree,
|
||||
self.object_class_by_name[name.lower()].oid,
|
||||
self.object_class_by_name[base_candidate.lower()].oid
|
||||
)
|
||||
)
|
||||
|
||||
def default_config() -> Config: # export
|
||||
|
|
|
|||
Loading…
Reference in a new issue