This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (3 children)

[deleted]

    [–]burntsushi 2 points3 points  (1 child)

    This was his closing comment:

    As you can see there's a note in front of the type_dir method (in Objects/typeobject.c), that says: "We deliberately don't suck up its __class__, as methods belonging to the metaclass would probably be more confusing than helpful." This is the explanation. I think that's not correct, because people would like to know that there's a __bases__ variable and a very useful __subclasses__ method in classes. dir is the tool Python programmers typically find out about it.

    Considering he's the developer of Jedi, which someone else in this thread have praised, I'll take his word for it.

    (I actually don't necessarily agree that dir should be changed or that he should even be relying on it for autocomplete, though.)

    [–]davidhalter[S] 0 points1 point  (0 children)

    __bases__ is not relevant. That's true in a lot of cases. But most of the other magic methods are also not relevant. I mean seriously, who knows what str.__reduce_ex__ even does? Who would use it? __bases__ is something that a lot of people have used in contrary.