Comment #11 on issue 3439 by jenshnie...@gmail.com: Don't pollute global
namaespace with plot.
http://code.google.com/p/sympy/issues/detail?id=3439
The issue that I was originally trying to raise is that:
Sorry, I remembered something that is clearly not right. You in general do
a better job than most on the namespace issue.
To return to the original issue I think that plot is a special case.
It is perfectly expected that doing from sympy import * overwrites all
mathematical functions in your global namespace (i.e. sin, cos, exp ect.)
but I don't think that it is expected that it overwrites plot. After all
the intro on the sympy homepage is "SymPy is a Python library for symbolic
mathematics" it does not claim to be a plotting lib. This I don't think
that it it expected that it overwrites the plot function. I would therefore
suggest that you consider changing line 70 in __init__.py from
"from plotting import plot, Plot, textplot, plot_backends, plot_implicit"
to remove this and do nothing further.
The way that sympy imports matplotlib.pyplot even when just doing "import
sympy" also causes problems because importing pyplot fixes the mpl backend
and breaks all the ipython pylab backend logic if called after import
sympy. I.e. https://github.com/ipython/ipython/issues/2035. Here importing
sympy to test if it is installed fixes the matplotlib backend to the
default one breaking the ipython selection of a non gui backend in the test
script which subsequently exposes a bug in pygtk that changes
sys.getdefaultencoding() and breaks a test in ipython. I believe that there
is also an issue with the pyQT backend since this import of matplotlib also
breaks the ipython logic to select the right api version of pyQT but it's
been a will since I looked at that.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.