Skip to content

TYP: rec.from{arrays,records} should accept names= without formats= - #31914

Merged
charris merged 1 commit into
numpy:mainfrom
jorenham:typing/rec.from{arrays,records}-accept-names-without-formats
Jul 8, 2026
Merged

charris merged 1 commit into
numpy:mainfrom
jorenham:typing/rec.from{arrays,records}-accept-names-without-formats

Conversation

@jorenham

@jorenham jorenham commented Jul 8, 2026

Copy link
Copy Markdown
Member

Previously, passing names without formats to np.rec.fromarrays and np.red.fromrecords was rejected, even though it's valid at runtime:

In [1]: np.rec.fromarrays([np.array([1., 2.]), np.array([3, 4])], names="a,b")
Out[1]: 
rec.array([(1., 3), (2., 4)],
          dtype=[('a', '<f8'), ('b', '<i8')])

Fully written by me (a human); bug found by Claude Fable 5 (here's the full (second) audit for those interested).

(more stub fixes on the way)

@jorenham jorenham added 09 - Backport-Candidate PRs tagged should be backported 41 - Static typing labels Jul 8, 2026
@charris
charris merged commit 64e2f48 into numpy:main Jul 8, 2026
14 checks passed
@charris

charris commented Jul 8, 2026

Copy link
Copy Markdown
Member

Thanks Joren.

@jorenham
jorenham deleted the typing/rec.from{arrays,records}-accept-names-without-formats branch July 8, 2026 12:40
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 8, 2026
jorenham added a commit that referenced this pull request Jul 8, 2026
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