Skip to content

Refactor unnecessary casts away from mypy #955

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

Closed
JukkaL opened this issue Oct 18, 2015 · 3 comments
Closed

Refactor unnecessary casts away from mypy #955

JukkaL opened this issue Oct 18, 2015 · 3 comments
Labels
refactoring Changing mypy's internals

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Oct 18, 2015

This is not a priority, but because of better isinstance type inference the mypy implementation now has a lot of redundant casts. Remove those that aren't needed and consider filing issues for remaining casts that we wouldn't need if mypy was more clever.

@JukkaL JukkaL added the refactoring Changing mypy's internals label Oct 18, 2015
@jhance
Copy link
Collaborator

jhance commented Oct 20, 2015

Idea on how to make this substantially easier: (see #958)

@rwbarton
Copy link
Contributor

rwbarton commented Jul 1, 2016

A little while ago I removed most of the ones that weren't needed any more, though mypy has again gotten slightly smarter since then. Might be a good time to do another pass of removing unneeded casts and filing issues for the ones that mypy ought to be able to not need.

@gvanrossum gvanrossum added this to the Future milestone Jul 7, 2016
@ddfisher
Copy link
Collaborator

ddfisher commented Jul 7, 2016

We should probably just run mypy with --warn-redundant-casts every once in a while as part of general cleanliness/good practice.

@ddfisher ddfisher closed this as completed Jul 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Changing mypy's internals
Projects
None yet
Development

No branches or pull requests

5 participants