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/055482.html below:

[Python-Dev] SWIG and rlcompleter

[Python-Dev] SWIG and rlcompleter [Python-Dev] SWIG and rlcompleterTimothy Fitz firemoth at gmail.com
Wed Aug 17 20:55:30 CEST 2005
On 8/16/05, Raymond Hettinger <raymond.hettinger at verizon.net> wrote:
> -0  The behavior of dir() already a bit magical.  Python is much simpler
> to comprehend if we have direct relationships like dir() and vars()
> corresponding as closely as possible to the object's dictionary.  If
> someone injects non-strings into an attribute dictionary, why should
> dir() hide that fact?

Indeed, there seem to be two camps, those who want dir to reflect __dict__
and those who want dir to reflect attributes of an object. It seems to
me that those who want dir to reflect __dict__ should just use
__dict__ in the first place.

However, in the case of dir handling non-strings, should dir handle
non-valid identifiers as well, that is to say that while
foo.__dict__[2] = ... is an obvious case what about foo.__dict__["1"]
?

Right now the documentation says that it returns "attributes", and I
would not consider non-strings to be attributes, so either the
documentation or the implementation should rectify this disagreement.
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