Skip to content

Support from_dtype(numpy.dtypes.StringDType)#4756

Merged
Zac-HD merged 1 commit into
HypothesisWorks:masterfrom
Zac-HD:claude/hopeful-einstein-zhwDO
May 28, 2026
Merged

Support from_dtype(numpy.dtypes.StringDType)#4756
Zac-HD merged 1 commit into
HypothesisWorks:masterfrom
Zac-HD:claude/hopeful-einstein-zhwDO

Conversation

@Zac-HD
Copy link
Copy Markdown
Member

@Zac-HD Zac-HD commented May 28, 2026

Closes #4039.

@Zac-HD Zac-HD force-pushed the claude/hopeful-einstein-zhwDO branch 3 times, most recently from bff3770 to 369e2f9 Compare May 28, 2026 03:57
Comment thread hypothesis/tests/numpy/test_from_dtype.py
@Zac-HD Zac-HD force-pushed the claude/hopeful-einstein-zhwDO branch from 369e2f9 to 748f3f5 Compare May 28, 2026 07:29
from_dtype now natively supports numpy 2.0+ variable-width strings
(StringDType, kind 'T'), generating arbitrary strings via text().

Passing a dtype class such as np.dtypes.StringDType where an instance
was expected now raises a clear error, instead of the previous confusing
message (or silent coercion to the object dtype in arrays).
@Zac-HD Zac-HD force-pushed the claude/hopeful-einstein-zhwDO branch from 748f3f5 to 6cc9c3c Compare May 28, 2026 07:31
@Zac-HD Zac-HD merged commit 05a605b into HypothesisWorks:master May 28, 2026
77 checks passed
@ngoldbaum
Copy link
Copy Markdown
Contributor

Thank you! I'm glad it was straightforward to support.

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.

Improve support for new and user-defined Numpy dtypes (e.g. np.dtypes.StringDType)

4 participants