-
-
Notifications
You must be signed in to change notification settings - Fork 330
remove use of _deprecated_positional_args decorator #3093
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
base: 3.1.0
Are you sure you want to change the base?
Conversation
* add fill_value output to info * changelog * fix tests * fix example in docs
* issues: add pep-723 to issue template * use zarr main branch + make copyable * corret example link + not uv specific
* The ruff ruleset is TC, not TCH * Apply ruff/flake8-type-checking rule TC006 TC006 Add quotes to type expression in `typing.cast()` * Apply ruff/flake8-type-checking rule TC003 TC003 Move standard library import into a type-checking block --------- Co-authored-by: David Stansby <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intent of _deprecate_positional_args
is not to make every argument keyword-only, but only the ones that are already keyword-only in the signature. So no actual arguments should be changed to be keyword only here - the decorator should merely be removed.
As a working example, note how the first call does not raise a warning, but the second call does here:
# /// script
# dependencies = [
# "zarr==3.0.8",
# ]
# ///
import zarr
root = zarr.group(store='data/example.zarr')
foo = root.create_array('foo', shape=(1000, 100), chunks=(10, 10), dtype='f4')
foo = root.create_array('foo', (1000, 100), chunks=(10, 10), dtype='f4')
thanks for the clarification @dstansby! I'll adjust the PR accordingly. |
For every function decorated with
_deprecate_positional_args
, I removed the decoratorand made the function arguments keyword-only.This should only go in 3.1.0.
addresess #3092