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

feat: min and max methods for number lists #39

Closed
qexat opened this issue Apr 22, 2024 · 0 comments
Closed

feat: min and max methods for number lists #39

qexat opened this issue Apr 22, 2024 · 0 comments
Assignees
Labels
feat New feature or request fixed on main This issue has been fixed on the main branch
Milestone

Comments

@qexat
Copy link
Owner

qexat commented Apr 22, 2024

Feature request

Title Revision
Add the methods min and max. 1

Ideas

Given the existence of .sum() and .mean(), it would make sense to have .min() and .max() methods for numeric lists.

The functions signatures would be:

@typing.overload
def min[NumberT: int | float | complex](self: list[NumberT]) -> NumberT: ...
@typing.overload
def min(self) -> typing_extensions.Never: ...
@typing.overload
def max[NumberT: int | float | complex](self: list[NumberT]) -> NumberT: ...
@typing.overload
def max(self) -> typing_extensions.Never: ...

Considerations

Considering self to be the list that the method is being called on.

  • self must be non-empty
  • self must contain numerical items
@qexat qexat added the feat New feature or request label Apr 22, 2024
@qexat qexat added this to the v2.4.x milestone Apr 22, 2024
@qexat qexat self-assigned this Apr 22, 2024
qexat added a commit that referenced this issue Apr 22, 2024
qexat added a commit that referenced this issue Apr 22, 2024
@qexat qexat added the fixed on main This issue has been fixed on the main branch label Apr 22, 2024
@qexat qexat closed this as completed Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request fixed on main This issue has been fixed on the main branch
Projects
None yet
Development

No branches or pull requests

1 participant