A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-August/055444.html below:

[Python-Dev] SWIG and rlcompleter

[Python-Dev] SWIG and rlcompleter [Python-Dev] SWIG and rlcompleterMichael Hudson mwh at python.net
Tue Aug 16 13:35:43 CEST 2005
jepler at unpythonic.net writes:

> You don't need something like a buggy SWIG to put non-strings in dir().
>
>>>> class C: pass
> ...
>>>> C.__dict__[3] = "bad wolf"
>>>> dir(C)
> [3, '__doc__', '__module__']
>
> This is likely to happen "legitimately", for instance in a class that allows
> x.y and x['y'] to mean the same thing. (if the user assigns to x[3])

I wonder if dir() should strip non-strings?

Cheers,
mwh

-- 
  <radix> A VoIP server "powered entirely by stabbing, that I made
          out of this gun I had"                -- from Twisted.Quotes
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4