Skip to content

refactor: add type hints to maths/softmax.py#14153

Open
N9sha18 wants to merge 1 commit intoTheAlgorithms:masterfrom
N9sha18:type-hint-cleanup
Open

refactor: add type hints to maths/softmax.py#14153
N9sha18 wants to merge 1 commit intoTheAlgorithms:masterfrom
N9sha18:type-hint-cleanup

Conversation

@N9sha18
Copy link
Copy Markdown

@N9sha18 N9sha18 commented Jan 19, 2026

Added modern type hints (np.ndarray | list | tuple) to the softmax function to improve code readability and compliance with current Python standards. Verified with doctest (4 passed)

@poyea poyea force-pushed the type-hint-cleanup branch from 3207df5 to f76d44d Compare January 25, 2026 14:02
@algorithms-keeper algorithms-keeper Bot added the awaiting reviews This PR is ready to be reviewed label Jan 25, 2026
@poyea poyea requested a review from Copilot January 25, 2026 14:02
@algorithms-keeper algorithms-keeper Bot removed the awaiting reviews This PR is ready to be reviewed label Jan 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds modern Python type hints to maths/softmax.py to improve readability and align the function signature with current typing style.

Changes:

  • Annotated softmax() input and return types using PEP 604 unions.
  • Cleaned up docstring formatting and doctest inputs for consistency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread maths/softmax.py
Comment thread maths/softmax.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants