zero323 commented on a change in pull request #34374:
URL: https://github.com/apache/spark/pull/34374#discussion_r741816277



##########
File path: python/pyspark/rdd.pyi
##########
@@ -60,6 +60,7 @@ from pyspark.sql._typing import RowLike
 from py4j.java_gateway import JavaObject  # type: ignore[import]
 
 T = TypeVar("T")
+T_ = TypeVar("T_", covariant=True)

Review comment:
       NumPy and some of the typeshed annotations use `_T`, `_T_co` and 
`_T_contra` for invariant, covariant, and contravariant respectively. It is a 
bit verbose for my taste, but otherwise looks good.
   
   Other projects I've seen (dry-python, django-stubs, pfun) don't use any 
special convention. Not the way I'd go :)

##########
File path: python/pyspark/rdd.pyi
##########
@@ -60,6 +60,7 @@ from pyspark.sql._typing import RowLike
 from py4j.java_gateway import JavaObject  # type: ignore[import]
 
 T = TypeVar("T")
+T_ = TypeVar("T_", covariant=True)

Review comment:
       NumPy and some of the typeshed annotations use `_T`, `_T_co` and 
`_T_contra` for invariant, covariant, and contravariant respectively. It is a 
bit verbose for my taste, but otherwise looks good.
   
   Other projects I've seen (dry-python, django-stubs, pfun) don't use any 
special convention. Not the way I'd go :)




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to