Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

TYP: allow inplace division of NDArray[timedelta64] by floats #28994

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
Loading
from

Conversation

jorenham
Copy link
Member

@jorenham jorenham commented May 17, 2025

this fixes the following valid example from being falsely rejected by static type checkers

import numpy as np

a = np.array([0, None], np.timedelta64)
a.__itruediv__(3.14)
a.__ifloordiv__(3.14)

This was typed correctly in the __{true,floor}div__ methods, which apparently made it so that a /= 3.14 and a /= 3.14 already was accepted. So that's probably why this issue wasn't noticed before.

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.

1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.