|
From: Guy K. K. <g....@ma...> - 2010-09-15 21:48:36
|
On Thu, 16 Sep 2010 06:49:55 Bruce Sherwood wrote: > I want to leave "from visual import *" in place, I strongly disagree. > a "batteries included" environment (also a pythonic concept). "Batteries included" is, but not batteries constantly inserted and discharging! As I sais, with Py3k you're facing a change in code and samples anyway. And I think that something like C Anthony's suggestion gives the freedom of retaining backwards compatibility with only a minor fix, just for convenience reason. But the *norm* in Python is to have things split up into places where they belong, and to not overshadow things (paradigm "explicit is better than implicit"). So if I want to use the cosine function (cos()), then I'm either going to import it *myself* from math or numpy, depending on what I want. And I do not want to be tripped up by some awkward changes as an unexpected one is being called. Besides, things like these mathematical functions don't really belong into a package called "visual" anyway. So, my suggestion: * Use the convenience of a Py3k switch to sanitise the API. * Remove all the wild card imports, and have the user import what they need. * For newbie's convenience, provide a "physicists make happy" package that does the wild card imports all across the board. (Even though I'm of the opinion that this dirty short cut creates more head scratching in the future than it helps up front ...) Guy -- Guy K. Kloss Institute of Information and Mathematical Sciences Te Kura Pūtaiao o Mōhiohio me Pāngarau Massey University, Albany (North Shore City, Auckland) 473 State Highway 17, Gate 1, Mailroom, Quad B Building voice: +64 9 414-0800 ext. 9266 fax: +64 9 441-8181 G....@ma... http://www.massey.ac.nz/~gkloss |