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

enable meta.delegates to enforce KEYWORD_ONLY for kwargs from #459

Merged
merged 5 commits into from
Aug 11, 2022

Conversation

EmbraceLife
Copy link
Contributor

The details of this PR can be found in this forum thread.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Contributor

@jph00 jph00 left a comment

Choose a reason for hiding this comment

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

Many thanks for the PR. I've made one suggested change (but haven't tested it -- so take a look and see if it works for you!).

You've accidentally added the whole _docs directory to your PR. Could you please remove it? I've just updated .gitignore so that this shouldn't happen again in the future.

fastcore/meta.py Outdated
@@ -120,20 +120,21 @@ def _f(f):
k = sigd.pop('kwargs')
s2 = {k:v for k,v in inspect.signature(to_f).parameters.items()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
s2 = {k:v for k,v in inspect.signature(to_f).parameters.items()
s2 = {k:v.replace(kind=inspect.Parameter.KEYWORD_ONLY) for k,v in inspect.signature(to_f).parameters.items()

If you made this change, would that mean you could then remove the line you added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this change works and my added line can be removed. Thanks Jeremy!

Copy link
Contributor

Choose a reason for hiding this comment

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

Great. Just reply here when you've removed the _docs folder and we should be ready to go!

@EmbraceLife
Copy link
Contributor Author

I have reverted my first troublesome commit and then only run nbdev_prepare this time without running all the cells, nor running nbdev_docs and nbdev_preview, so that I didn't generate so many differences.

@jph00
Copy link
Contributor

jph00 commented Aug 10, 2022

Good job!

@jph00 jph00 merged commit 0a94e22 into AnswerDotAI:master Aug 11, 2022
Copy link
Contributor Author

Thank you Jeremy! This is my first contribution to fastcore, Wow!

@jph00 jph00 added the enhancement New feature or request label Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants