You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would be nice, but backward compatibility alone means we can't change dir() to return a dictionary. What you propose would make more sense as a new function, perhaps in a package like pydoc or a third-party tool like IPython.
ravi140222 commented on Apr 8, 2022
ravi140222mannequin
MannequinAuthor
More actions
would adding an argument to dir be a possible solution,
like,
This is the kind of thing that people implement as a utility and publish on pypl. After a few years, if it's stable and has many users, it becomes possible to discuss adding it to the stdlib (which requires a PEP). You don't start by adding it to the stdlib.
Reacted by Alex Waygood, Jelle Zijlstra and Eric Fahlgren
sorry, i am new to this, and dont know much about pypl (or is it pypi?), i created a pull request for this also, and added it to pydoc.py that is this,
could you inform me where would be the suitable place for the function i created. is this the pypl url? https://github.com/pypa/warehouse
will i have to create some package and then do something like pip install enhanced_dir, but i have only one function in it.
Activity
ravi140222 commentedon Apr 7, 2022
current dir gives output like this,
but wouldn't it be better if the output was like this,
???
JelleZijlstra commentedon Apr 7, 2022
This would be nice, but backward compatibility alone means we can't change dir() to return a dictionary. What you propose would make more sense as a new function, perhaps in a package like pydoc or a third-party tool like IPython.
ravi140222 commentedon Apr 8, 2022
would adding an argument to dir be a possible solution,
like,
ravi140222 commentedon Apr 8, 2022
plus I would want it to have some more methods,
using enhanced dir should give,
obtained from, (here only printing, made a dictionary in the implementation in the PR)
this check fails for,
I would also want these,
which were obtained from,
and it fails for,
ravi140222 commentedon Apr 11, 2022
I would like this enhanced dir to have one more feature, that is the type of these functions, so, our enhanced dir would work something like this,
which gives,
pythongh-91410 updated dir in pydoc
vainaixr commentedon Apr 13, 2022
i think so one more thing could be added to it, could name the keyword as
checks,for example,
this would run a few checks on our argument, such as, whether it,
so, for
None, the output would be something like this,pythongh-91410 added checks
iritkatriel commentedon Apr 14, 2022
This is the kind of thing that people implement as a utility and publish on pypl. After a few years, if it's stable and has many users, it becomes possible to discuss adding it to the stdlib (which requires a PEP). You don't start by adding it to the stdlib.
vainaixr commentedon Apr 14, 2022
sorry, i am new to this, and dont know much about pypl (or is it pypi?), i created a pull request for this also, and added it to
pydoc.pythat is this,#91449
could you inform me where would be the suitable place for the function i created. is this the pypl url?
https://github.com/pypa/warehouse
will i have to create some package and then do something like
pip install enhanced_dir, but i have only one function in it.iritkatriel commentedon Apr 14, 2022
The cpython bug tracker and review system are not the places for learner questions. They are the places where we actually work in cpython.
Try python-list for general python questions and core-mentorship for questions about contributing to python.