New submission from apostofes <aivainjr...@gmail.com>:
current dir gives output like this, ``` from collection import OrderedDict od = OrderedDict({'a': 1, 'b': 2, 'c': 3}) print(dir(od)) ``` ``` ['__class__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'clear', 'copy', 'fromkeys', 'get', 'items', 'keys', 'move_to_end', 'pop', 'popitem', 'setdefault', 'update', 'values'] ``` but wouldn't it be better if the output was like this, ``` {'OrderedDict': {'__contains__', '__delitem__', '__dir__', '__eq__', '__format__', '__ge__', '__getitem__', '__gt__', '__init__', '__init_subclass__', '__iter__', '__le__', '__lt__', '__ne__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__setitem__', '__sizeof__', '__subclasshook__', 'clear', 'copy', 'fromkeys', 'get', 'items', 'keys', 'move_to_end', 'pop', 'popitem', 'setdefault', 'update', 'values'}, 'dict': {'__getattribute__', '__len__', '__new__'}, 'object': {'__delattr__', '__setattr__', '__str__'}} ``` ??? ---------- messages: 416948 nosy: apostofes priority: normal severity: normal status: open title: enhanced dir? type: enhancement versions: Python 3.11 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue47254> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com