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
Improve support for positional-only arguments #2706
Comments
Working 80/20 prototype, covering This could be shipped as-is without breaking anything that currently works, but I want to write some tests for use of positional-only args in While not relevant until we drop Python 3.7, this also means the obvious approach of replacing our pos-only workarounds in |
Oh dear. It turns out that the (the replacement being "do the same thing as we do for all the generated/non-explicit examples") |
Having dug into this, I'm going to keep positional-only arguments in a function wrapped by (later update: subsequent work allows |
#2218 proposed that we should "consider replacing uses of
inspect.getfullargspec()
withinspect.signature()
" after dropping support for Python 2, which would also help with #2495. With the increasing adoption of positional-only arguments (PEP 570, Python 3.8 and later), I think this has only become more urgent.The main concern is our
@proxies()
decorator, which wraps end-user code in a variety of places... and silently breaks positional-only arguments because they're unsupported by our internaldefine_function_signature()
. In particular, this affects@st.composite
and stateful testing methods.Secondary concerns include
@given()
(currently restricted to args-xor-kwargs, which reduces impact), or ourst.builds()
and Djangofrom_model()
strategies (current workarounds are fine, but don't work with true pos-only arguments after we drop Python 3.7).The text was updated successfully, but these errors were encountered: