Skip to content

TYP: Add test which hits np.array constructor overload with object: _SupportsArray[_ArrayT] #29428

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

Merged
merged 4 commits into from
Jul 29, 2025

Conversation

MarcoGorelli
Copy link
Member

Without this change, the overload

@overload
def array(
object: _SupportsArray[_ArrayT],
dtype: None = ...,
*,
copy: bool | _CopyMode | None = ...,
order: _OrderKACF = ...,
subok: L[True],
ndmin: L[0] = ...,
like: _SupportsArrayFunc | None = ...,
) -> _ArrayT: ...

can be deleted and the typing tests still all pass

Here's a test which would fail without that overload

Copy link
Member

@jorenham jorenham left a comment

Choose a reason for hiding this comment

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

Good catch!

@MarcoGorelli MarcoGorelli marked this pull request as ready for review July 23, 2025 17:30
Copy link
Member

@jorenham jorenham left a comment

Choose a reason for hiding this comment

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

some nits I forgot to pick

Copy link
Member

@jorenham jorenham left a comment

Choose a reason for hiding this comment

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

some nits I forgot to pick

MarcoGorelli and others added 3 commits July 29, 2025 10:12
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
@jorenham jorenham merged commit bb7dd1b into numpy:main Jul 29, 2025
77 of 78 checks passed
@jorenham
Copy link
Member

Thanks!

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.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy