Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-101118: correct function signatures in the math module docs#101120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
skirpichev wants to merge1 commit intopython:mainfromskirpichev:fix-101118
Closed

gh-101118: correct function signatures in the math module docs#101120

skirpichev wants to merge1 commit intopython:mainfromskirpichev:fix-101118

Conversation

skirpichev
Copy link
Contributor

@skirpichevskirpichev commentedJan 18, 2023
edited by bedevere-bot
Loading

Copy link
Member

@sobolevnsobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Right now we haven't decided yet what to do with positional only args in the docs.

Some maintainers add them, some later remove them, some prefer not to touch it.

This is just for the context for this change :)

@rhettinger
Copy link
Contributor

There was a decision not to add these to the docs because lay readers mostly find them confusing, because it makes the docs harder to read, and there are no known usability issues with the docs as they are now. So exceptions have been made for functions likessorted() that have a complex signature that users need to know about. In the case of the math module, we don't get users writingsin(x=pi/4) so these edits are just gratuitous.

@skirpichev
Copy link
ContributorAuthor

skirpichev commentedJan 18, 2023
edited
Loading

Well, the inspect module does very clear distinction:

>>>deffoo(x):pass# like e.g. math.ceil shown in docs...>>>defbar(x,/):pass...>>>inspect.signature(foo)<Signature (x)>>>>inspect.signature(bar)<Signature (x,/)>>>>foo(x=1)>>>bar(x=1)# that's how math,ceil behave in the realityTraceback (mostrecentcalllast):File"<stdin>",line1,in<module>TypeError:bar()gotsomepositional-onlyargumentspassedaskeywordarguments:'x'

So exceptions have been made for functions likes sorted() that have a complex signature

The os module seems to be one using "/". I doubt that theos.setegid has a complex signature.

Sorry for the nitpick, anyway.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@sobolevnsobolevnsobolevn left review comments

Assignees
No one assigned
Labels
awaiting reviewdocsDocumentation in the Doc dirskip news
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@skirpichev@rhettinger@sobolevn@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp