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

feat: use static arguments instead of **kwargs #815

Merged
merged 1 commit into from Apr 12, 2024

Conversation

henryiii
Copy link
Collaborator

@henryiii henryiii commented Apr 10, 2024

Close #813. This provides better documentation, better signatures, and better static typing. This doesn't change too rapidly, so using ** isn't that helpful. ** is best for things that can't be determined statically.

A few kwargs that previously distinguished between not being passed and being passed now support None, which is simpler and also a little friendlier for callers.

Warning

This removes support for passing keyword arguments through to a function passed into run. run(f, arg1, kw=kw) is not supported anymore. This does keep support for run(f, arg1). There's very little reason to ever do this, as it just runs the function for you with a smidge of logging. It's listed in the comment as a legacy feature. It was a little buggy before too, with env= for example being swallowed.

@henryiii henryiii marked this pull request as ready for review April 10, 2024 05:51
@henryiii henryiii changed the title feat: use static arguments instaed of **kwargs feat: use static arguments instead of **kwargs Apr 10, 2024
Copy link
Collaborator

@cjolowicz cjolowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Breaking keyword arguments for run with functions seems fine, given that feature has been deprecated and undocumented for a long time. (I don't think it's ever been formally deprecated, but I don't think that's necessary here.)

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii henryiii merged commit d3dd1f8 into wntrblm:main Apr 12, 2024
22 checks passed
@henryiii henryiii deleted the henryiii/feat/staticargs branch April 12, 2024 22:10
@henryiii henryiii mentioned this pull request Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Remove legacy support for running a function in run?
2 participants