Skip to content
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

Arguments in function types should be contravariant #15

Closed
JukkaL opened this issue Dec 11, 2012 · 0 comments
Closed

Arguments in function types should be contravariant #15

JukkaL opened this issue Dec 11, 2012 · 0 comments
Assignees
Labels

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Dec 11, 2012

Currently function types are invariant with respect to argument types. This makes it impossible to use some useful and common idioms, for example:

print(list(map(str, [1, 2, 3])))

Function subtyping (and type inference, if needed) should be modified so that the above code works.

However, argument types should perhaps still be invariant in overriding to avoid complications with overloading.

@ghost ghost assigned JukkaL Dec 12, 2012
@JukkaL JukkaL closed this as completed Dec 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant