From: Gregor L. <gl...@ao...> - 2002-07-08 23:03:06
|
Hi! I'm still a newbie in looking behind the scene. When playing around with VPython I encountered the following: >>> from visual import * Visual-2002-06-14 >>> s=3Dsphere() # beautiful white sphere displayed immediately >>> s <Primitive object at 0x01563D34> >>> dir(s) ['__class__', 'axis', 'blue', 'color', 'constr', 'display', 'frame', 'green', 'name', 'pos', 'radius',=20 'red', 'rotate', 'up', 'visible', 'x', 'y', 'z'] >>> s.__methods__ ['rotate'] >>> s.__dict__ {'__class__': <built-in method sphere of tuple object at 0x00A65590>} >>> s.__members__ ['axis', 'blue', 'color', 'display', 'frame', 'green',=20 'pos', 'radius', 'red', 'up', 'visible', 'x', 'y', 'z'] >>> s.name Traceback (most recent call last): File "<pyshell#7>", line 1, in ? s.name AttributeError: name >>>=20 So, what are 'name' and 'constr', which both do not appear neither in s.__members__ nor in s.__dict__ nor in s.__methods__, but in the list returned by dir(s)? (Or: what is generally returned by dir() ?) Perhaps there is somebody who can explain this.=20 Thanks, Gregor |