Skip to content

Conversation

@RSzipper
Copy link

Summary of Changes

  • Added start parameter to math.sp (shortened from math_sumprod) for consistency with sum() and math.prod().
  • Updated mathmodule.c.h and mathmodule.c to reflect the change.
  • Modified function signatures and implementation to support an optional starting value.

Related Issue

Closes gh-130270

Additional Notes

  • Ensures math.sp(p, q, start=x) starts summation from x instead of always defaulting to 0.
  • Maintains strict length checking for input iterables.

@bedevere-app
Copy link

bedevere-app bot commented Feb 19, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@RSzipper RSzipper force-pushed the issue130270-add-start-param branch from 48d616d to 278078c Compare February 19, 2025 10:41
@bedevere-app
Copy link

bedevere-app bot commented Feb 19, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@skirpichev skirpichev closed this Feb 19, 2025
@skirpichev
Copy link
Contributor

See issue thread.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

math.sumprod should support a start parameter like sum and math.prod

2 participants