Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong docstring of method Number.__rdivmod__(self, other) #95433

Closed
XuehaiPan opened this issue Jul 29, 2022 · 1 comment
Closed

Wrong docstring of method Number.__rdivmod__(self, other) #95433

XuehaiPan opened this issue Jul 29, 2022 · 1 comment
Labels
docs Documentation in the Doc dir

Comments

@XuehaiPan
Copy link
Contributor

XuehaiPan commented Jul 29, 2022

Documentation

(A clear and concise description of the issue.)

A tiny error for the docstring of method Number.__rdivmod__. The order of self and other is swapped in the docstring.

cpython/Lib/numbers.py

Lines 197 to 211 in a41b51d

def __divmod__(self, other):
"""divmod(self, other): The pair (self // other, self % other).
Sometimes this can be computed faster than the pair of
operations.
"""
return (self // other, self % other)
def __rdivmod__(self, other):
"""divmod(other, self): The pair (self // other, self % other).
Sometimes this can be computed faster than the pair of
operations.
"""
return (other // self, other % self)

     def __rdivmod__(self, other): 
-        """divmod(other, self): The pair (self // other, self % other).
+        """divmod(other, self): The pair (other // self, other % self).

         Sometimes this can be computed faster than the pair of 
         operations. 
         """ 
         return (other // self, other % self) 
@XuehaiPan XuehaiPan added the docs Documentation in the Doc dir label Jul 29, 2022
@XuehaiPan
Copy link
Contributor Author

Already fixed by #31991. Closing.

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

No branches or pull requests

1 participant