From: Craig S. <cra...@ma...> - 2010-10-08 15:37:30
|
I don't see vobjects as necessary, but maybe I am missing something. In every other Python module I've used, I can choose to either import module contents in its namespace: import visual.primitives as vp Or I can explicitly bring select functions, classes, etc. into the current namespace: from visual.primitives import curve I think anything outside the friendly visual package ought to behave like any typical standard Python package. I also will add that Guy's proposal to make the clean version of the module be part of a different namespace (e.g. vpython, libvisual, visuallib [like matplotlib], or vispy [like scipy/numpy]) has merit. I do think it will be confusing and error prone to have the friendly visual module and the clean modules in similarly named name spaces. Craig On Oct 7, 2010, at 9:26 PM, Bruce Sherwood wrote: > I'm confused. I thought that what I'd proposed achieves the desired > effect, so I don't understand what the issue is. To repeat: > > ----------------------------------------------------------------- > Suppose there is in the visual folder a file vobjects.py containing this: > > from .primitives import (arrow, cylinder, cone, sphere, box, ring, > label, frame, pyramid, ellipsoid, curve ,faces, convex, > helix, points, text, distant_light, local_light) > > Then you could do this: > > import visual.vobjects as vo > c = vo.curve(pos=[(0,0,0), (1,0,0), (0,1,0)]) > > Would this be preferable to the following? > > from visual.primitives import curve > c = curve(pos=[(0,0,0), (1,0,0), (0,1,0)]) > > Similarly, there could be a visual/vector.py file for the vector stuff > (vector, mag, etc.). There are already visual.crayola and > visual.materials files of this kind. > ----------------------------------------------------------- > > In what way does this not meet expert needs? > > Guy, I'm sorry, perhaps I was distracted at the time, but I don't > remember your having made a specific proposal. What I thought had > happened when you first brought this up was that you were studying the > issues. Is your solution very different from mine? > > Bruce Sherwood > > P.S. There is another import issue I failed to identify, which is that > the text object imports some font- and polygon-handling modules, and > some cleanup may be called for in the submodule file primitives.py. > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today. > http://p.sf.net/sfu/beautyoftheweb > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users -- Craig A. Struble, Ph.D. | Marquette University Associate Professor of Computer Science | 369 Cudahy Hall (414)288-3783 | (414)288-5472 (fax) http://www.mscs.mu.edu/~cstruble | cra...@ma... |