Re: [Python-Dev] __dir__, part 2

2006-11-11 Thread Georg Brandl
Guido van Rossum wrote: (what about vars(), btw?) Interesting question! Right now vars() and dir() don't seem to use the same set of keys; e.g.: class C: pass ... c = C() c.foo = 42 vars(c) {'foo': 42} dir(c) ['__doc__', '__module__', 'foo'] It makes some sense for vars(x) to

Re: [Python-Dev] __dir__, part 2

2006-11-11 Thread Georg Brandl
Fredrik Lundh wrote: Guido van Rossum wrote: No objection on targetting 2.6 if other developers agree. Seems this is well under way. good work! given that dir() is used extensively by introspection tools, I'm not sure I'm positive to a __dir__ that *overrides* the standard dir()

Re: [Python-Dev] __dir__, part 2

2006-11-11 Thread Nick Coghlan
Fredrik Lundh wrote: Guido van Rossum wrote: No objection on targetting 2.6 if other developers agree. Seems this is well under way. good work! given that dir() is used extensively by introspection tools, I'm not sure I'm positive to a __dir__ that *overrides* the standard dir()

Re: [Python-Dev] __dir__, part 2

2006-11-10 Thread Fredrik Lundh
Guido van Rossum wrote: No objection on targetting 2.6 if other developers agree. Seems this is well under way. good work! given that dir() is used extensively by introspection tools, I'm not sure I'm positive to a __dir__ that *overrides* the standard dir() behaviour. *adding* to the default

Re: [Python-Dev] __dir__, part 2

2006-11-10 Thread Guido van Rossum
On 11/10/06, Fredrik Lundh [EMAIL PROTECTED] wrote: Guido van Rossum wrote: No objection on targetting 2.6 if other developers agree. Seems this is well under way. good work! given that dir() is used extensively by introspection tools, I'm not sure I'm positive to a __dir__ that

Re: [Python-Dev] __dir__, part 2

2006-11-10 Thread Thomas Heller
Fredrik Lundh schrieb: Guido van Rossum wrote: No objection on targetting 2.6 if other developers agree. Seems this is well under way. good work! given that dir() is used extensively by introspection tools, I'm not sure I'm positive to a __dir__ that *overrides* the standard dir()

Re: [Python-Dev] __dir__, part 2

2006-11-10 Thread Fredrik Lundh
Guido van Rossum wrote: I think that ought to go into the guidlines for what's an acceptable __dir__ implementation. We don't try to stop people from overriding __add__ as subtraction either. to me, overriding dir() is a lot more like overriding id() than over- riding +. I don't think an

Re: [Python-Dev] __dir__, part 2

2006-11-10 Thread Guido van Rossum
On 11/10/06, Fredrik Lundh [EMAIL PROTECTED] wrote: Guido van Rossum wrote: I think that ought to go into the guidlines for what's an acceptable __dir__ implementation. We don't try to stop people from overriding __add__ as subtraction either. to me, overriding dir() is a lot more like

Re: [Python-Dev] __dir__, part 2

2006-11-07 Thread Anthony Baxter
On Tuesday 07 November 2006 19:00, Guido van Rossum wrote: No objection on targetting 2.6 if other developers agree. Seems this is well under way. good work! Sounds fine to me! Less magic under the hood is less magic, and that's always a good thing. The use case for it seems completely

Re: [Python-Dev] __dir__, part 2

2006-11-07 Thread tomer filiba
okay, everything's fixed. i updated the patch and added a small test to: Lib/test/test_builtins.py::test_dir -tomer On 11/7/06, Nick Coghlan [EMAIL PROTECTED] wrote: tomer filiba wrote: cool. first time i build the entire interpreter, 'twas fun :) currently i retained support for

Re: [Python-Dev] __dir__, part 2

2006-11-07 Thread tomer filiba
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). oops, i meant everything except that -tomer On 11/7/06, tomer filiba [EMAIL PROTECTED] wrote: okay, everything's fixed.

[Python-Dev] __dir__, part 2

2006-11-06 Thread tomer filiba
so, if you remember, i suggested adding __dir__ to objects, so as to make dir() customizable, remove the deprecated __methods__ and __members__, and make it symmetrical to other built-in functions. you can see the original post here:

Re: [Python-Dev] __dir__, part 2

2006-11-06 Thread tomer filiba
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

Re: [Python-Dev] __dir__, part 2

2006-11-06 Thread Nick Coghlan
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