| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Expand Up | @@ -1518,7 +1518,8 @@ class FuncAnimation(TimedAnimation): | |||||||||||||||||
| func : callable | ||||||||||||||||||
| The function to call at each frame. The first argument will | ||||||||||||||||||
| be the next value in *frames*. Any additional positional | ||||||||||||||||||
| arguments can be supplied via the *fargs* parameter. | ||||||||||||||||||
| arguments can be supplied via the *fargs* parameter. See *fargs* for | ||||||||||||||||||
| how to use `functools.partial` to supply keyword arguments. | ||||||||||||||||||
|
|
||||||||||||||||||
| The required signature is:: | ||||||||||||||||||
|
|
||||||||||||||||||
| Expand Down Expand Up | @@ -1564,6 +1565,14 @@ def init_func() -> iterable_of_artists | |||||||||||||||||
| fargs : tuple or None, optional | ||||||||||||||||||
| Additional arguments to pass to each call to *func*. | ||||||||||||||||||
|
|
||||||||||||||||||
| An option to *fargs* is to use `functools.partial`, with the added | ||||||||||||||||||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
Sorry, something went wrong.
All reactions
|
||||||||||||||||||
| benefit of also supporting keyword arguments. An example is to pass | ||||||||||||||||||
| something like:: | ||||||||||||||||||
|
|
||||||||||||||||||
| partial(func, **kwargs) | ||||||||||||||||||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityWouldn't you normally have the case that you want to set some kwargs explicitly? Then I suggest to make the example more concrete:
Suggested change
Maye even show a more complete FuncAnimation call to show this fits in.
Sorry, something went wrong.
All reactions
|
||||||||||||||||||
|
|
||||||||||||||||||
| as *func*. | ||||||||||||||||||
|
|
||||||||||||||||||
|
Comment thread
Comment on lines
+1568
to
+1575
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityI think if you move the intro of partial up to func, this can be simplified to
Suggested change
Sorry, something went wrong.
All reactions
|
||||||||||||||||||
| save_count : int, default: 100 | ||||||||||||||||||
| Fallback for the number of values from *frames* to cache. This is | ||||||||||||||||||
| only used if the number of frames cannot be inferred from *frames*, | ||||||||||||||||||
| Expand Down | ||||||||||||||||||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityFlipped because I think the functools version is preferred. I think it's gonna be clearer to add the information about partial in this section since it's passed in as the func keyword, Maybe after the required signature, something like:
To pass in a function with positional keywords, set func to the partial function:: func = partial(func, frame, **kwargs)Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.