Display default parameter values instead of ellipses #2616
fj128
started this conversation in
Enhancement
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I do
it prints
help(pathlib.Path.mkdir)
works similarly (need toimport pathlib
first of course).Hovering over the definition on the other hand gives
I would very much prefer seeing actual default values and I hope that it's obvious that in this case it's nontrivial to guess but important to know what they are.
I understand that there might be interesting corner cases, for example what if the default value is an
object()
sentinel? But if the built-inhelp()
ignores the issue, you can too, I think.I suspect that the lack of this feature (or an active misfeature, since it should be easier to do what
help()
does instead of going out of your way replacing default values with ellipses) has something to do withtypeshed-fallback/stdlib/builtins.pyi
and other stub files which understandably use ellipses instead of default parameters (fun fact:open()
has 7 overloads there). If that's the case, please don't let the perfect be the enemy of the good, I'd much prefer seeing non-stubbed functions with actual default values and stubbed functions with ellipses (until someone does the boring thing) than for both to suck uniformly.Beta Was this translation helpful? Give feedback.
All reactions