Skip to content

gh-102823: Document return type of floor division on floats#102824

Merged
hugovk merged 4 commits into
python:mainfrom
mdickinson:gh-102823-document-floordiv-for-floats
Sep 7, 2023
Merged

gh-102823: Document return type of floor division on floats#102824
hugovk merged 4 commits into
python:mainfrom
mdickinson:gh-102823-document-floordiv-for-floats

Conversation

@mdickinson

@mdickinson mdickinson commented Mar 19, 2023

Copy link
Copy Markdown
Member

This PR documents the long-standing behaviour that the floor division operator // applied to float operands returns a result of type float.

Also adds a missing note to the table to note that x // y isn't valid for complex numbers.

Comment thread Doc/library/stdtypes.rst
Comment thread Doc/library/stdtypes.rst
Comment thread Doc/library/stdtypes.rst
Comment thread Doc/library/stdtypes.rst

@Eclips4 Eclips4 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Indeed, information about mixed arithmetic is given above.
LGTM

Comment thread Doc/library/stdtypes.rst Outdated

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@hugovk hugovk enabled auto-merge (squash) September 7, 2023 14:13
@hugovk hugovk added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Sep 7, 2023
@hugovk hugovk merged commit b72251d into python:main Sep 7, 2023
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @mdickinson for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 7, 2023
…thonGH-102824)

(cherry picked from commit b72251d)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
@bedevere-bot

Copy link
Copy Markdown

GH-109092 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Sep 7, 2023
@bedevere-bot

Copy link
Copy Markdown

GH-109093 is a backport of this pull request to the 3.11 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 7, 2023
…thonGH-102824)

(cherry picked from commit b72251d)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Sep 7, 2023
hugovk added a commit that referenced this pull request Sep 7, 2023
…H-102824) (#109093)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Yhg1s pushed a commit that referenced this pull request Sep 8, 2023
…H-102824) (#109092)

gh-102823: Document return type of floor division on floats (GH-102824)
(cherry picked from commit b72251d)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants