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



##########
File path: python/pyspark/_typing.pyi
##########
@@ -21,11 +21,14 @@ from typing_extensions import Protocol
 
 F = TypeVar("F", bound=Callable)
 T = TypeVar("T", covariant=True)
+U = TypeVar("U", bound="SupportsIAdd")

Review comment:
       Why would add bound for protocol?

##########
File path: python/pyspark/_typing.pyi
##########
@@ -21,11 +21,14 @@ from typing_extensions import Protocol
 
 F = TypeVar("F", bound=Callable)
 T = TypeVar("T", covariant=True)
+U = TypeVar("U", bound="SupportsIAdd")
 
 PrimitiveType = Union[bool, float, int, str]
 
 class SupportsIAdd(Protocol):
-    def __iadd__(self, other: SupportsIAdd) -> SupportsIAdd: ...
+    def __add__(self: U, other: U) -> U: ...
+
+    def __iadd__(self: U, other: U) -> U: ...

Review comment:
       Also, why this change of signature?

##########
File path: python/pyspark/_typing.pyi
##########
@@ -21,11 +21,14 @@ from typing_extensions import Protocol
 
 F = TypeVar("F", bound=Callable)
 T = TypeVar("T", covariant=True)
+U = TypeVar("U", bound="SupportsIAdd")

Review comment:
       Why would add bound for protocol?

##########
File path: python/pyspark/_typing.pyi
##########
@@ -21,11 +21,14 @@ from typing_extensions import Protocol
 
 F = TypeVar("F", bound=Callable)
 T = TypeVar("T", covariant=True)
+U = TypeVar("U", bound="SupportsIAdd")
 
 PrimitiveType = Union[bool, float, int, str]
 
 class SupportsIAdd(Protocol):
-    def __iadd__(self, other: SupportsIAdd) -> SupportsIAdd: ...
+    def __add__(self: U, other: U) -> U: ...
+
+    def __iadd__(self: U, other: U) -> U: ...

Review comment:
       Also, why this change of signature?




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