11from copy import copy
22from inspect import isclass
3- from typing import Type , TypeVar , Union , Tuple , Callable
3+ from typing import TypeVar , Union , Tuple , Callable # do not import Type for compatibility with earlier python 3.5
44from warnings import warn
55import sys
66
@@ -509,7 +509,7 @@ def _(*expressions: _LambdaExpression) -> Union[_LambdaExpression.LambdaFunction
509509""" Alias for '_' """
510510
511511
512- def InputVar (symbol : str = None , typ : Type [T ] = None ) -> Union [T , _LambdaExpression ]:
512+ def InputVar (symbol : str = None , typ : ' Type[T]' = None ) -> Union [T , _LambdaExpression ]:
513513 """
514514 Creates a variable to use in validator expression. The optional `typ` argument may be used to get a variable with
515515 appropriate syntactic completion from your IDE, but is not used for anything else.
@@ -551,7 +551,7 @@ def Constant(value: T, name: str = None) -> Union[T, _LambdaExpression]:
551551""" Alias for 'Constant' """
552552
553553
554- def make_lambda_friendly_class (typ : Type , name : str = None ):
554+ def make_lambda_friendly_class (typ : ' Type[T]' , name : str = None ) -> 'Union[Type[T], _LambdaExpression]' :
555555 """
556556 Utility method to transform a standard class into a class usable inside lambda expressions, as in
557557 DDataFrame = C(DataFrame), so as to be able to use it in expressions
@@ -563,7 +563,7 @@ def make_lambda_friendly_class(typ: Type, name: str = None):
563563 return Constant (typ , name = name )
564564
565565
566- def make_lambda_friendly_method (method : Callable , name : str = None ):
566+ def make_lambda_friendly_method (method : Callable , name : str = None ) -> _LambdaExpression :
567567 """
568568 Utility method to transform any method whatever their signature (positional and/or keyword arguments,
569569 variable-length included) into a method usable inside lambda expressions, even if some of the arguments are
0 commit comments