Author: georg.brandl
Date: Mon Mar 12 14:15:14 2007
New Revision: 54286
Modified:
python/branches/p3yk/Objects/object.c
Log:
Check the keys of the locals dict -- they need not be a list.
Modified: python/branches/p3yk/Objects/object.c
==
I assume this is not the desired behaviour?
>>> class F:
... def __dir__(self):
... return [5]
...
>>> dir(F())
[5]
>>> f = F()
>>> dir(f)
[5]
>>> def __dir__(): return [10]
...
>>> f.__dir__ = __dir__
>>> dir(f)
[5]
I think the problem is in _dir_object()
+ PyObject * dirfunc = PyOb
Whoops, pulled the trigger too soon.
I also wanted to point out that in the example below__dir__() is
returning non-strings. Is that ok, even though attributes must be
strings?
n
--
On 3/12/07, Neal Norwitz <[EMAIL PROTECTED]> wrote:
> I assume this is not the desired behaviour?
>
> >>> class F
Neal Norwitz schrieb:
> I assume this is not the desired behaviour?
>
class F:
> ... def __dir__(self):
> ... return [5]
> ...
dir(F())
> [5]
f = F()
dir(f)
> [5]
def __dir__(): return [10]
> ...
f.__dir__ = __dir__
dir(f)
> [5]
>
> I think the problem is