From: <ajs...@op...> - 2003-03-18 17:23:10
|
The fact that the VPython vector object has no __class__ attribute seems inconsistent with the current status of Python objects.Happens that it is creating a practical problem in something I am attempting. The issue is illustrated as follows: >>> from visual import * Visual-2003-03-15 >>> lis = [1,2,3] >>> tup =(1,2,3) >>> vec = vector(1,2,3) >>> lis.__class__ <type 'list'> >>> tup.__class__ <type 'tuple'> >>> vec.__class__ Traceback (most recent call last): File "<pyshell#6>", line 1, in ? vec.__class__ AttributeError: __class__ If I am not mistaken, the __class__ attributte of lists and tuples did not exist at the time VPython was originally written. So at that time, it was consistent. The change I have in mind would, I think, bring the vector object more in line with the type/class unification scheme to which Python has moved. I have not - at this point - looked at the VPython code in this regard. But assume it is a minor patch. My problem is, assuming that I can do the patch myself, I need to know that what I am doing using it will ultimately work with the official distributiion. So..... Art |