Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TYP: Support iteration of StringDType arrays #29227

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 1 commit into from
Jun 19, 2025

Conversation

jorenham
Copy link
Member

No description provided.

This comment has been minimized.

@jorenham

This comment was marked as outdated.

@jorenham jorenham force-pushed the typing/ndarray-StringDType-iter branch from e995a20 to 2b0eda3 Compare June 18, 2025 17:35
Copy link

Diff from mypy_primer, showing the effect of this PR on type check results on a corpus of open source code:

static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/index.py:352: error: Item "IndexBase" of "IndexBase | Iterable[TLabel] | Iterable[Sequence[TLabel]]" has no attribute "flags"  [union-attr]
+ static_frame/core/index.py:352: error: Item "Iterable[TLabel]" of "IndexBase | Iterable[TLabel] | Iterable[Sequence[TLabel]]" has no attribute "flags"  [union-attr]
+ static_frame/core/index.py:352: error: Item "Iterable[Sequence[TLabel]]" of "IndexBase | Iterable[TLabel] | Iterable[Sequence[TLabel]]" has no attribute "flags"  [union-attr]

@jorenham
Copy link
Member Author

I don't see how the static-frame mypy error is related to this change. Maybe it's a nondeterministic mypy issue with type-narrowing?

https://github.com/static-frame/static-frame/blob/d561ee05d686269507ca160a314c35b908d11232/static_frame/core/index.py#L352

@charris charris merged commit a27cc51 into numpy:main Jun 19, 2025
88 of 90 checks passed
@charris
Copy link
Member

charris commented Jun 19, 2025

Thanks Joren.

@jorenham jorenham deleted the typing/ndarray-StringDType-iter branch June 19, 2025 15:06
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.

2 participants