docs: Fix mypy

pull/8960/head
Daniel Mensinger 3 years ago
parent 4e1e98cc31
commit 239219220e
No known key found for this signature in database
GPG Key ID: 54DD94C131E277D4
  1. 2
      docs/refman/generatorbase.py
  2. 1
      docs/refman/generatormd.py
  3. 1
      docs/refman/generatorprint.py
  4. 3
      docs/refman/loaderbase.py

@ -37,7 +37,7 @@ class GeneratorBase(metaclass=ABCMeta):
@staticmethod
def sorted_and_filtered(raw: T.List[_N]) -> T.List[_N]:
def key_fn(fn: Function) -> str:
def key_fn(fn: NamedObject) -> str:
if isinstance(fn, Method):
return f'1_{fn.obj.name}.{fn.name}'
return f'0_{fn.name}'

@ -45,6 +45,7 @@ FunctionDictType = T.Dict[
T.Dict[str, T.Dict[str, PlaceholderTypes]],
T.Dict[str, T.List[T.Dict[str, PlaceholderTypes]]],
T.List[T.Dict[str, PlaceholderTypes]],
T.List[str],
]
]

@ -42,7 +42,6 @@ class GeneratorPrint(GeneratorBase):
mlog.log('Pos args: ', mlog.bold(str([x.name for x in func.posargs])))
mlog.log('Opt args: ', mlog.bold(str([x.name for x in func.optargs])))
mlog.log('Varargs: ', mlog.bold(func.varargs.name if func.varargs is not None else 'null'))
mlog.log('Kwargs base:', mlog.bold(func.kwargs_inherit.name if func.kwargs_inherit else 'null'))
mlog.log('Kwargs: ', mlog.bold(str(list(func.kwargs.keys()))))
def _generate_object(self, obj: Object) -> None:

@ -21,6 +21,7 @@ from .model import (
NamedObject,
FetureCheck,
ArgBase,
PosArg,
DataTypeInfo,
Type,
Function,
@ -123,7 +124,7 @@ class _Resolver:
func.kwargs.update(missing)
# Handloe other args inheritance
_T = T.TypeVar('_T', bound=T.Union[ArgBase, T.List[ArgBase]])
_T = T.TypeVar('_T', bound=T.Union[ArgBase, T.List[PosArg]])
def resolve_inherit(name: str, curr: _T, resolver: T.Callable[[Function], _T]) -> _T:
if name and not curr:
name = name.strip()

Loading…
Cancel
Save