Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add hackability to use_kwargs_dict#279

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
marii-moe wants to merge1 commit intoAnswerDotAI:master
base:master
Choose a base branch
Loading
frommarii-moe:kwargs_dcit

Conversation

@marii-moe
Copy link
Contributor

To support the 'val_'+kwargs here:fastai/fastai#3133

Idea is to allow a little bit of hack-ability touse_kwargs_dict instead of writing specialdelegates function for my one off use case. Maybe not a good idea?

_wrap is reproducing the behavior indelegates, didn't want to change the default behavior ofuse_kwargs_dict, as I am not very familiar with its usage._wrap allows the stacking of multipleuse_kwargs_dict ordelegates when keep=True, otherwise they would error when**kwargs is removed by firstdelegates`use_kwargs_dict`. (tests should make this more clear).

Mostly looking for guidance here on if this makes sense, or if I should try something else. Here is example usage for easy reference:

@use_kwargs_dict(y=1,z=None)@use_kwargs_dict(x=2,wrap=True,keep=True)def foo(a, b=1, **kwargs): passtest_sig(foo, '(a, b=1, *, x=2, y=1, z=None)')@use_kwargs_dict(**{ 'val_'+k:v for k,v in get_kwargs_dict(foo).items()})@use_kwargs_dict(**get_kwargs_dict(foo),wrap=True,keep=True)def goo(g=4, **kwargs): passtest_sig(goo, '(g=4, *, b=1, x=2, y=1, z=None, val_b=1, val_x=2, val_y=1, val_z=None)')

@review-notebook-app
Copy link

Check out this pull request on ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered byReviewNB

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@marii-moe

[8]ページ先頭

©2009-2025 Movatter.jp