-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signatures of overloaded methods are incompatible with supertypes, even if they really are #3262
Comments
This looks like me, if somebody else doesn't get it first.
… On Apr 26, 2017, at 9:49 AM, Ryan Gonzalez ***@***.***> wrote:
e.g.
from typing import overload
class A:
@overload
def f(self, x: str) -> str: ...
@overload
def f(self, y: int) -> int: ...
class B(A):
@overload
def f(self, x: str) -> str: ...
@overload
def f(self, y: int) -> int: ...
@overload
def f(self, z: bytes) -> bytes: ...
IMO in this case, it should still be compatible, since B supports A's full API, just with another extra function.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@sixolet I think you might be around 10 seconds too late... ;) |
refi64
added a commit
to refi64/mypy
that referenced
this issue
Apr 26, 2017
@sixolet Can you review @kirbyfan64's review? |
Yep, though probably tomorrow.
… On Apr 26, 2017, at 10:27 AM, Guido van Rossum ***@***.***> wrote:
@sixolet Can you review @kirbyfan64's review?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
refi64
added a commit
to refi64/mypy
that referenced
this issue
Apr 27, 2017
refi64
added a commit
to refi64/mypy
that referenced
this issue
Apr 28, 2017
Did this get fixed or not? |
PR [#3263] still out last I checked.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
e.g.
IMO in this case, it should still be compatible, since
B
supportsA
's full API, just with another extra function.The text was updated successfully, but these errors were encountered: