Skip to content
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

Star-arg unpacking after a keyword argument is strongly discouraged #355

Open
DimitriPapadopoulos opened this issue Mar 4, 2024 · 1 comment
Labels

Comments

@DimitriPapadopoulos
Copy link
Collaborator

DimitriPapadopoulos commented Mar 4, 2024

instance = nipype_factory(arg0, base_class=cls, *nargs, **nkwargs)

super().__init__(
definition=definition,
activate_copy=True,
inputs_to_copy=inputs_to_copy,
inputs_to_symlink=inputs_to_symlink,
inputs_to_clean=inputs_to_clean,
use_temp_output_dir=use_temp_output_dir,
*args,
**kwargs,
)

super().__init__(
definition=definition,
activate_copy=False,
use_temp_output_dir=use_temp_output_dir,
*args,
**kwargs,
)

See flake8-bugbear B026 star-arg-unpacking-after-keyword-arg:

Why is this bad?

In Python, you can use star-argument unpacking to pass a list or tuple of arguments to a function.

Providing a star-argument after a keyword argument can lead to confusing behavior, and is only supported for backwards compatibility.

@DimitriPapadopoulos
Copy link
Collaborator Author

We may remove this exception once we fix these issues:

"B026",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant