A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-November/069879.html below:

[Python-Dev] __dir__, part 2

[Python-Dev] __dir__, part 2Nick Coghlan ncoghlan at gmail.com
Mon Nov 6 23:57:07 CET 2006
tomer filiba wrote:
> cool. first time i build the entire interpreter, 'twas fun :)
> currently i "retained" support for __members__ and __methods__,
> so it doesn't break anything and is compatible with 2.6.
> 
> i really hope it will be included in 2.6 as today i'm using ugly hacks
> in RPyC to make remote objects appear like local ones.
> having __dir__ solves all of my problems.
> 
> besides, it makes a lot of sense of define __dir__ for classes that
> define __getattr__. i don't think it should be pushed back to py3k.
> 
> here's the patch:
> http://sourceforge.net/tracker/index.php?func=detail&aid=1591665&group_id=5470&atid=305470

As I noted on the tracker, PyObject_Dir is a public C API function, so it's 
behaviour needs to be preserved as well as the behaviour of calling dir() from 
Python code.

So the final form of the patch will likely need to include stronger tests for 
that section of the API, as well as updating the documentation in various 
places (the dir and PyObject_Dir documentation, obviously, but also the list 
of magic methods in the language reference).

+1 on targeting 2.6, too.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
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