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

'import cPickle as pickle' "already defined" error #2253

Closed
Daenyth opened this issue Oct 14, 2016 · 1 comment
Closed

'import cPickle as pickle' "already defined" error #2253

Daenyth opened this issue Oct 14, 2016 · 1 comment

Comments

@Daenyth
Copy link

Daenyth commented Oct 14, 2016

This python code generates an error. It's a common idiom and it would be good if mypy could check for it in some way.

try:
    import cPickle as pickle
except ImportError:
    import pickle
$ mypy --py2 --silent-imports bad.py
bad.py:4: error: Name 'pickle' already defined
@gvanrossum
Copy link
Member

Thanks -- this looks like a duplicate of #1153. Additional discussion can go there.

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

No branches or pull requests

2 participants