You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/11/03 10:44:25 UTC

[GitHub] [spark] zero323 commented on a change in pull request #34374: [SPARK-37104][PYTHON] Make RDD and DStream covariant

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 :)




-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org