dchvn commented on a change in pull request #34433: URL: https://github.com/apache/spark/pull/34433#discussion_r747411405
########## File path: python/pyspark/__init__.py ########## @@ -63,44 +64,56 @@ from pyspark.version import __version__ from pyspark._globals import _NoValue # noqa: F401 +T = TypeVar("T") +F = TypeVar("F", bound=Callable) -def since(version): + +def since(version: Union[str, float]) -> Callable[[T], T]: """ A decorator that annotates a function to append the version of Spark the function was added. """ import re indent_p = re.compile(r"\n( +)") - def deco(f): - indents = indent_p.findall(f.__doc__) + def deco(f: T) -> T: Review comment: I think we expect the output is ```Callable[[T], T]``` so deco should be ```T -> ```. Did I misunderstand? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org