Skip to content

Implement subtype checking when right-hand side is a generic callable #1340

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

Merged
merged 1 commit into from
Apr 6, 2016

Conversation

rwbarton
Copy link
Contributor

@rwbarton rwbarton commented Apr 6, 2016

This ended up amounting to just removing a check!

Fixes #1236. But something is still not right when using type
variables constrained to a list of values; added a failing test for
that case.

def fn(n: B) -> None: pass
def identity(f: A) -> A:
return f
identity(fn)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to add a test here that actually tries to call the result too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a good idea. Added.

This ended up amounting to just removing a check!

Fixes python#1236. But something is still not right when using type
variables constrained to a list of values; added a failing test for
that case.
@rwbarton rwbarton force-pushed the rwbarton-generic-callable branch from 5792141 to 7446fc0 Compare April 6, 2016 21:33
@gvanrossum gvanrossum merged commit f3c1c55 into python:master Apr 6, 2016
@rwbarton rwbarton deleted the rwbarton-generic-callable branch April 7, 2016 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants