[issue1056293] dir() should only return strings

2009-03-19 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

It's a feature request and it looks like except of Skip Montanaro in 
2004, nobody requires this feature. I don't like my patch because it 
slows down Python just for a very rare case (this issue).

I choose to close it. Reopen this issue if you think that this feature 
(check type of dir() result) is a must have ;-)

--
resolution:  - wont fix
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1056293
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1056293] dir() should only return strings

2009-02-16 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Yes, the issue still exists in 2009. Attached patch contains a test + 
a patch to test the type of each value of the dir() result.

I'm not sure that it's a good idea to apply my patch. It's maybe not 
the job of Python to check the types of dir() result.

--
keywords: +patch
nosy: +haypo
Added file: http://bugs.python.org/file13109/dir_type.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1056293
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1056293] dir() should only return strings

2009-02-08 Thread Daniel Diniz

Daniel Diniz aja...@gmail.com added the comment:

Still present in trunk:69418:

class obj: pass

obj.__dict__[1] = 0
[k for k in dir(obj) if k.startswith(set_)]

--
nosy: +ajaksu2
type:  - behavior
versions: +Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1056293
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com