all linting done, now docs
This commit is contained in:
parent
962a3a2d32
commit
9499eeff5f
1 changed files with 3 additions and 7 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
# pylint: disable=missing-raises-doc
|
||||||
import inspect
|
import inspect
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from inspect import FullArgSpec
|
from inspect import FullArgSpec
|
||||||
|
|
@ -22,9 +23,6 @@ from ytdl_sub.script.types.resolvable import Resolvable
|
||||||
from ytdl_sub.script.types.variable import Variable
|
from ytdl_sub.script.types.variable import Variable
|
||||||
from ytdl_sub.script.utils.exceptions import UNREACHABLE
|
from ytdl_sub.script.utils.exceptions import UNREACHABLE
|
||||||
|
|
||||||
# pylint: disable=missing-raises-doc
|
|
||||||
|
|
||||||
|
|
||||||
TLambda = TypeVar("TLambda", bound=Lambda)
|
TLambda = TypeVar("TLambda", bound=Lambda)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -86,10 +84,8 @@ def _is_type_compatible(
|
||||||
for union_type in arg_type.__args__:
|
for union_type in arg_type.__args__:
|
||||||
if not _is_type_compatible(union_type, expected_arg_type):
|
if not _is_type_compatible(union_type, expected_arg_type):
|
||||||
return False
|
return False
|
||||||
elif issubclass(arg_type, NamedCustomFunction):
|
elif issubclass(arg_type, (NamedCustomFunction, Variable)):
|
||||||
return True # custom-function, can be anything, so pass for now
|
return True # custom-function/variable can be anything, so pass for now
|
||||||
elif issubclass(arg_type, Variable):
|
|
||||||
return True # unresolved variables can be anything, so pass for now
|
|
||||||
elif issubclass(arg_type, Lambda) and issubclass(expected_arg_type, arg_type):
|
elif issubclass(arg_type, Lambda) and issubclass(expected_arg_type, arg_type):
|
||||||
# lambda, check if expected_arg_type is a subclass
|
# lambda, check if expected_arg_type is a subclass
|
||||||
# Do not return on just that to also allow lambdas to be returned as
|
# Do not return on just that to also allow lambdas to be returned as
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue