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-125897: Use positional-only parameter indicators forrange()#125945

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

Merged
terryjreedy merged 1 commit intopython:mainfromkbaikov:fix-issue-125897
Aug 11, 2025

Conversation

@kbaikov
Copy link
Contributor

@kbaikovkbaikov commentedOct 24, 2024
edited by bedevere-appbot
Loading

Addresses the#125897 documentation discrepancy that the range function accepts step as a kwarg


📚 Documentation preview 📚:https://cpython-previews--125945.org.readthedocs.build/

@ghost
Copy link

ghost commentedOct 24, 2024
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-appbedevere-appbot added docsDocumentation in the Doc dir skip news awaiting review labelsOct 24, 2024
@mpagempage changed the titlegn-125897: FIx the range function refering to step as a kwarggh-125897: FIx the range function refering to step as a kwargOct 24, 2024
@mpagempage changed the titlegh-125897: FIx the range function refering to step as a kwarggh-125897: Fix the range function refering to step as a kwargOct 24, 2024
Addresses thepython#125897 documentation discrepancy that the range function accepts step as a kwarg
@skirpichev
Copy link
Contributor

@kbaikov, please avoid force-pushes:https://devguide.python.org/getting-started/pull-request-lifecycle

kbaikov and nineteendo reacted with thumbs up emoji

@kbaikov
Copy link
ContributorAuthor

A friendly ping. Is there any decision on this issue/PR? How do i proceed?

@skirpichev
Copy link
Contributor

CC@nedbat

Perhaps,https://devguide.python.org/documentation/style-guide/#function-signatures requires a clarification. Is this for new code? How we should handle current sphinx docs, that use funny square bracket syntax?

@merwokmerwok changed the titlegh-125897: Fix the range function refering to step as a kwarggh-125897: Fix range function doc referring to step as a kwargFeb 24, 2025
Copy link
Member

@terryjreedyterryjreedy left a comment
edited
Loading

Choose a reason for hiding this comment

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

In#137610, Serhiy proposes to put/s everywhere they belong, and I strongly support this. HIs PR#137609 includes the 2 additions here, so he also approves them. I think that this should be merged first so that OP gets the proper credit.

..class::range(stop)
range(start, stop, step=1)
..class::range(stop, /)
range(start, stop, step=1, /)
Copy link
Member

Choose a reason for hiding this comment

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

I think enumerating all three cases is slightly nicer. Thestep argument is for advanced use-cases. Thoguhts@terryjreedy?

Suggested change
range(start, stop,step=1,/)
range(start, stop, /)
range(start, stop, step, /)

Copy link
Member

Choose a reason for hiding this comment

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

I generally prefer fewer lines, partly from experience with IDLE call tips (which would be similar in other IDEs). Serhiy generally went with fewer in his PR, as he did here, except where really needed. Two are really needed here, since the true Python-implementaton signature(start_or_stop, stop_if_needed=None, step=1, /) is definitely too baroque for the doc.

Given your approval, I will merge this and backport (as Serhiy plans to backport his changes).

AA-Turner reacted with thumbs up emoji
@terryjreedyterryjreedy added needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsAug 11, 2025
@AA-TurnerAA-Turner changed the titlegh-125897: Fix range function doc referring to step as a kwarggh-125897: Use positional-only parameter indicators forrange()Aug 11, 2025
@AA-TurnerAA-Turner changed the titlegh-125897: Use positional-only parameter indicators forrange()gh-125897: Use positional-only parameter indicators forrange()Aug 11, 2025
@terryjreedyterryjreedy merged commit0c83daa intopython:mainAug 11, 2025
34 checks passed
@github-project-automationgithub-project-automationbot moved this fromTodo toDone inDocs PRsAug 11, 2025
@miss-islington-app
Copy link

Thanks@kbaikov for the PR, and@terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestAug 11, 2025
…ythonGH-125945)(cherry picked from commit0c83daa)Co-authored-by: Konstantin Baikov <konstantin.baikov@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestAug 11, 2025
…ythonGH-125945)(cherry picked from commit0c83daa)Co-authored-by: Konstantin Baikov <konstantin.baikov@gmail.com>
@bedevere-app
Copy link

GH-137652 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelAug 11, 2025
@bedevere-app
Copy link

GH-137653 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelAug 11, 2025
AA-Turner pushed a commit that referenced this pull requestAug 11, 2025
…H-125945) (#137653)Co-authored-by: Konstantin Baikov <konstantin.baikov@gmail.com>
maurycy added a commit to maurycy/cpython that referenced this pull requestAug 12, 2025
* main:pythongh-137288: Update 3.14 magic numbers (pythonGH-137665)pythongh-135228: When@DataClass(slots=True) replaces a dataclass, make the original class collectible (take 2) (pythonGH-137047)pythongh-126008: Improve docstrings for Tkinter cget and configure methods (pythonGH-133303)pythongh-131885: Use positional-only markers for ``max()`` and ``min()`` (python#131868)pythonGH-137426: Remove code deprecation of `importlib.abc.ResourceLoader` (pythonGH-137567)pythongh-125897: Mark range function parameters as positional only (python#125945)pythongh-137400: Fix a crash when disabling profiling across all threads (pythongh-137471)pythongh-115766: Fix IPv4Interface.is_unspecified (pythonGH-137326)pythongh-128813: cleanup C-API docs for PyComplexObject (pythonGH-137579)pythongh-135953: Profile a module or script with sampling profiler (python#136777)  Fix documentation of hash in PyHash_FuncDef (python#137595)
@kbaikovkbaikov deleted the fix-issue-125897 branchAugust 12, 2025 22:25
hugovk pushed a commit that referenced this pull requestSep 11, 2025
…H-125945) (#137652)Co-authored-by: Konstantin Baikov <konstantin.baikov@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra left review comments

@skirpichevskirpichevskirpichev approved these changes

@willingcwillingcwillingc left review comments

@terryjreedyterryjreedyterryjreedy approved these changes

@chris-eiblchris-eiblchris-eibl left review comments

@AA-TurnerAA-TurnerAA-Turner approved these changes

+1 more reviewer

@travis-pdstravis-pdstravis-pds left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

docsDocumentation in the Doc dirskip news

Projects

Status: Done

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

8 participants

@kbaikov@skirpichev@JelleZijlstra@willingc@AA-Turner@terryjreedy@travis-pds@chris-eibl

[8]ページ先頭

©2009-2025 Movatter.jp