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
We could optionally add similar support for the other str.isX methods, which mostly impose simpler constraints and could be satisfied more efficiently by replacing the self.elements strategy (e.g. str.isspace requires all-whitespace chars), and for some adding the filter on at the end (e.g. str.isupper is satisfied if all cased characters in the string are uppercase and there is at least one cased character).
Note that st.characters().filter(...) will often be considerably simpler; we can compute and cache the allowed characters directly - although often more quickly than by naive iteration, if we're willing to spend some code on it.
The text was updated successfully, but these errors were encountered:
As a follow-up to #2693 (comment) and #3134, I'd like to return an efficient strategy for
st.text(...).filter(str.isidentifier)
.Adapting https://github.com/Zac-HD/hypothesmith/blob/85358991f8498db489569e81ac9dc9049c75773f/src/hypothesmith/syntactic.py#L39-L56 should make this pretty easy, even with the slight complication of incorporating the restrictions of the
alphabet=
strategy.We could optionally add similar support for the other
str.isX
methods, which mostly impose simpler constraints and could be satisfied more efficiently by replacing theself.elements
strategy (e.g.str.isspace
requires all-whitespace chars), and for some adding the filter on at the end (e.g.str.isupper
is satisfied if all cased characters in the string are uppercase and there is at least one cased character).Note that
st.characters().filter(...)
will often be considerably simpler; we can compute and cache the allowed characters directly - although often more quickly than by naive iteration, if we're willing to spend some code on it.The text was updated successfully, but these errors were encountered: