[Python-Dev] SWIG and rlcompleter

Fernando Perez fperez.net at gmail.com
Mon Aug 15 22:48:48 CEST 2005


Guido van Rossum wrote:

> (1) Please use the SF patch manager.
> 
> (2) Please don't propose adding more bare "except:" clauses to the
> standard library.
> 
> (3) I think a better patch is to use str(word)[:n] instead of word[:n].

Sorry to jump in, but this same patch was proposed for ipython, and my reply
was that it appeared to me as a SWIG bug.  From:

http://www.python.org/doc/2.4.1/lib/built-in-funcs.html

the docs for dir() seem to suggest that dir() should only return strings (I am
inferring that from things like 'The resulting list is sorted
alphabetically').  The docs are not fully explicit on this, though.

Am I interpreting the docs correctly, case in which this should be considered a
SWIG bug?  Or is it OK for objects to stuff non-strings in __dict__, case in
which SWIG is OK and then rlcompleter (and the corresponding system in
ipython) do need to protect against this situation.

I'd appreciate a clarification here, so I can close my own ipython bug report
as well.

Thanks,

f



More information about the Python-Dev mailing list