From: Bruce S. <Bru...@nc...> - 2009-10-22 04:25:02
|
Yes, I should have said either "import visual2" or "from visual2 import *". The key point is that neither of these imports would import anything from math or numpy beyond what is utterly essential for visual itself to run. I should comment that the backwards compatibility issue has lots of ramifications that may not be obvious. For example, there are many faculty who run demos in their lectures that were written in VPython, and they themselves may not know much about the environment, and they may be running on classroom computers over which they have no control. These computers are periodically updated by a central university classroom technology group. If "from visual import *" breaks due to a new version of Python and Visual being installed, it's an educational disaster when the unsuspecting faculty member in the middle of class finds that an important demo program doesn't run. Bruce Sherwood Guy K. Kloss wrote: > On Thu, 22 Oct 2009 15:12:42 Tony Risinger wrote: >> Why not just "import visual2"? Isn't the * somewhat discouraged? >> >> I would rather have to important math/numpy stuff myself if I need >> them, and let the visual.* namespace be nothing but sphere/display/etc. > > Yeah, that's been discussed in the past ... > > The issues are (A) backwards compatibility, and (B) ease of use for students > otherwise *not* into programming, that they have got immediate and instant > access at a huge fund of useful functions for the purpose. > > Having said that, myself, I'm much more a fan of keeping it clean as well. > > So that's the reasoning behind the suggestion(s). > > Guy > |