You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
E TypeError: Instance and class checks can only be used with @runtime_checkable protocols
I'm using python3.10 and from my uv.lock I see
[[package]]
name = "hypothesis"
version = "6.112.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "attrs" },
{ name = "exceptiongroup", marker = "python_full_version < '3.11'" },
{ name = "sortedcontainers" },
]
The text was updated successfully, but these errors were encountered:
ClementWalter
changed the title
st.from_types weirdly requires int not to throw
st.from_types with Union and Protocol weirdly requires int not to throw
Dec 1, 2024
Well, that's definitely not ideal - but I think the intended behavior is to throw even if int is included, because isinstance(x, IsDataclass) will raise TypeError: Instance and class checks can only be used with @runtime_checkable protocols without Hypothesis involved at all. (and st.from_type() has to be able to check isinstance()/issubclass() to work)
So our main project is to work out why adding int stops that error from appearing, and see if we can make it consistent 🙂
I've managed to extract this MWE from my buggy tests
Defining
Extended
withoutint
, ie just likewill crash with
I'm using python3.10 and from my
uv.lock
I seeThe text was updated successfully, but these errors were encountered: