[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread R. David Murray
R. David Murray added the comment: That's not how people use it at the interactive prompt, though. I call dir(str) to find what methods I can call on an str object, not what methods I can call on the str class object. Same goes for my own classes. Yes, I also call it on instances, but it wou

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread Ramchandra Apte
Ramchandra Apte added the comment: -1 classes themselves are objects, so dir should list the attributes/methods of the class object, not the instances. -- nosy: +Ramchandra Apte ___ Python tracker

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread Ramchandra Apte
Ramchandra Apte added the comment: On 11 September 2013 21:41, Ethan Furman wrote: > > Ethan Furman added the comment: > > So when you do a `dir(int)` you don't want to know what you can call on 7? > You'd rather know what you can call on 'type'? > > -- > >

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread Ethan Furman
Ethan Furman added the comment: So when you do a `dir(int)` you don't want to know what you can call on 7? You'd rather know what you can call on 'type'? -- ___ Python tracker

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread Ethan Furman
Ethan Furman added the comment: It's going to take more than "I think that that's not true," to get a change made. >From http://docs.python.org/2/library/functions.html#dir : > > Because dir() is supplied primarily as a convenience for use at an > interactive prompt, it tries to supply an inte

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread R. David Murray
R. David Murray added the comment: As far as I know dir has always worked this way with classes (certainly back as far as 2.4, which is the oldest python I have on my dev system). So I doubt that this behavior can be open to change, whether or not we think the original decision was correct.

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread Ethan Furman
Changes by Ethan Furman : -- versions: -Python 2.6, Python 2.7, Python 3.1, Python 3.5 ___ Python tracker ___ ___ Python-bugs-list ma

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-11 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue19002] ``dir`` function does not work correctly with classes.

2013-09-10 Thread David Halter
New submission from David Halter: I recently stumbled over the ``dir`` function not working correctly with classes. This means that ``dir(object)`` won't list ``object.__bases__`` or ``object.__subclasses`` (and many other useful methods). I think that we should change that. The C function ``t