GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||
GeezerVison is showing github.com — gh-161591: sync sphinx docs with actual signatures in the inspect module by skirpichev · Pull Request #161594 · python/cpython Conversation
|
Documentation build overview
8 files changed ·
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I prefer sphinx's version of the argument name. But renaming would introduce API break (though hardly it's severe), not sure if it worth. Kept changes minimal, per issue description. But in fact many singnatures in the inspect module are out of sync with the real code and/or just invalid. Examples: .. function:: getmembers(object[, predicate]) [...] .. function:: getmembers_static(object[, predicate]) [...] I would prefer to fix all in one shot, in this pr, if reviewers support this. CC @sobolevn |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I suggest you fix the docs properly even if naming is a bit.. wrong |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
9458d81 to
d749ea3
Compare
|
Ok, lets use obj... But what about other signatures? Mentioned above could be fixed easily. Should I do it in this pr? Another one, formatargvalues() - probably must wait a better repr() for lambda, see #79037. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Mmh. Now that you say it, the docs are more meaningful. Here's what I suggest:
An alternative is to mark the first parmaeter as positional-only in the docs. It's a lie but... it would also hide the fact that it's an implementation detail and will forbid users to use named params.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Bénédikt Tran <[email protected]>
Ok, lets keep this as is.
You meant:
Sure, we can introduce breaking change that way, but IMO it's overkill. Hardly someone now uses signature(obj=foo) form versus positional argument.
Then next time someone else will point to inconsistency between docs and actual API. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Ok, so let's do the doc update first. That is, sync every signature with existing code first. And in a follow-up, I suggest we just break the signatures (but for that we need an issue and maybe someone else that would be ok with that) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Btw, which signature is typeshed using? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Done.
obj. It looks, they follow to sources. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Martin Panter <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.