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

Redifing any for numpy.any in the console #1675

Closed
spyder-bot opened this issue Feb 17, 2015 · 4 comments
Closed

Redifing any for numpy.any in the console #1675

spyder-bot opened this issue Feb 17, 2015 · 4 comments

Comments

@spyder-bot
Copy link
Collaborator

From imran.fa...@gmail.com on 2013-12-10T06:18:44Z

The automatic imports that Spyder does end up overwriting Python's built-in any() with numpy.any()

This has a dangerous side effect when dealing with generator expressions passed to any(). Python's any() will return a bool, but numpy.any() will return a gen objector.

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1675

@spyder-bot
Copy link
Collaborator Author

From contrebasse on 2013-12-10T05:15:07Z

If this is a problem for you, you can disable the "scientific startup script" in the advanced options of the console (in the preferences window).

@spyder-bot
Copy link
Collaborator Author

From imran.fa...@gmail.com on 2013-12-10T07:06:16Z

Thank you for providing that option. Nonetheless, I believe this silent default behavior is worth changing, considering it does NOT manifest in an error but silently "does the wrong thing" (because if generator_exp will always return True)

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-12-11T17:18:18Z

You are totally right. That's why this is going to be changed in 2.3 to not import anything by default.

Summary: Redifing any for numpy.any in the console (was: Mistakenly Redifing any() ?)
Status: Accepted
Labels: MS-v2.3 Cat-Console

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-05-01T20:37:42Z

This was fixed by revision 37076687f95b

Status: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant