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

Function signature mismatch for functools.reduce between C implementation, Python implementation, and online documentaion #102757

Closed
XuehaiPan opened this issue Mar 16, 2023 · 2 comments
Labels
docs Documentation in the Doc dir

Comments

@XuehaiPan
Copy link
Contributor

XuehaiPan commented Mar 16, 2023

Documentation

(A clear and concise description of the issue.)

The function signature mismatch for functools.reduce:

  • C implementation:

    _initial_missing = object()
    
    @overload
    def reduce(function, iterable, /): ...
    @overload
    def reduce(function, iterable, initial=_initial_missing, /): ...
  • Python implementation:

    _initial_missing = object()
    
    @overload
    def reduce(function, sequence): ...
    @overload
    def reduce(function, sequence, initial=_initial_missing): ...

Argument change: iterable -> sequence.

  • Online documentation:

    def reduce(function, iterable, initializer=None): ...

Argument change: initial -> initializer.

Linked PRs

@XuehaiPan
Copy link
Contributor Author

Can anyone have a look at this and my PR #102759?

carljm pushed a commit that referenced this issue Sep 18, 2023
@XuehaiPan
Copy link
Contributor Author

Closed via PR #102759.

csm10495 pushed a commit to csm10495/cpython that referenced this issue Sep 28, 2023
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