From: Guy K. K. <g....@ma...> - 2009-06-29 19:46:21
|
On Tue, 30 Jun 2009 00:15:09 Gary Ruben wrote: > would > adding another namespace within visual provide the best of both worlds - > that way one might do something like > "from visual.visual import *" > instead of "from visual import *" > if you just want the visual module without the other imports? Since when is obfuscation helpful? BTW, I am *not* intending to aim at breaking compatibility for the 5.x release series. I am aiming at hinting towards refining the API for maybe a future 6.x series. And I am intending to hint towards that in the spirit of Python, which is well established and it is what made the language as popular as it is today. These suggestions go fully conform with "The Zen of Python" (see below, you get it when typing "import this" in the interactive Python shell). In my opinion a refinement of the API in that direction for future release series would already touch 5 of the Zen of Python statements, and therefore largely serve the usability in Python at the little expense of having to adapt with the switch over from 5.x to 6.0" * Namespaces are one honking great idea -- let's do more of those! * Readability counts. * Special cases aren't special enough to break the rules. * In the face of ambiguity, refuse the temptation to guess. * There should be one-- and preferably only one --obvious way to do it. And it's not rocket science. I've patched the original sources within 30 minutes, and it's been quite helpful for me. As a proof of concept attached with a warning, that might also help others, I have provided these packages. So beware, they *will* break the common use and all examples, but they do retain the 5.x API. Guy In [32]: import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! -- 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. 9585 fax: +64 9 441-8181 G....@ma... http://www.massey.ac.nz/~gkloss |