win32all-142 available (Long)

Carl Caulkett carlca at dircon.co.uk
Sat Jan 5 10:55:30 EST 2002


In article <3C368646.5000400 at skippinet.com.au>, 
mhammond at skippinet.com.au says...
> I have fixed the win32com makepy problem with win32all-141.  It is 
> available at
> 
> http://users.bigpond.net.au/mhammond/win32all-142.exe
> 
> I have no idea how long it will work for - win32all-141.exe was still 
> there, even when it could not be downloaded.  NFI :)  I am still locked 
> out of my starship account, so I apologize for all this messing around.


Hi Mark,

One small issue so far. I am seeing multiple entries in the popup 
attribute window after pressing the '.' key. It appears to be related to 
levels of inheritence. An example explains it best:

l = list()
l.+----------
  |append
  |append
  |count
  |...

class list2(list):
    pass
l = list2()
l.+----------
  |append
  |append
  |append
  |count
  |...

class list3(list2):
    pass
l = list3()
l.+----------
  |append
  |append
  |append
  |append
  |count
  |...

The problem also occurs with the new 2.2 properties, and occurs for 
classic classes, new object descended classes, and built-in type 
descended classes. The problem does not occur with simple attributes.

<a few minutes later>

I've had a look in the source and have come up with a patch that seems 
to fix the problem:

D:\Python22\Pythonwin\pywin\scintilla\view.py (line 407)

#------------------------------------------------------
# Fix to remove duplicate entries 				
#------------------------------------------------------
# OLD CODE
#------------------------------------------------------
# if hasattr(ob, "__class__"):
#	 items = items + _get_class_attributes(ob.__class__)
#------------------------------------------------------
# NEW CODE BEGIN
#------------------------------------------------------
allitems = []
allitems.extend(_get_class_attributes(ob.__class__))
for item in allitems:
    if not item in items:
        items = items + item
#------------------------------------------------------
# NEW CODE END
#------------------------------------------------------

HTH.

-- 
Cheers,
Carl



More information about the Python-list mailing list