-
Notifications
You must be signed in to change notification settings - Fork 822
Update README.md #17
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
Update README.md #17
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -230,6 +230,19 @@ def create_menu(title, body, button_text, cancellable): | |
| # ... | ||
| ``` | ||
|
|
||
| **Light and good** | ||
| ```python | ||
| kargs = { | ||
| 'arg0': 'Hello', | ||
| 'arg1': 'World', | ||
| } | ||
|
|
||
| def myfunction(arg0, arg1): | ||
| print(f'arg0:{arg0} arg1:{arg1}') | ||
|
|
||
| myfunction(**kargs) | ||
|
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. It's correct that you can unpack a dict here, but I don't think it's good to use that here. Also no one can say that the keys in the dictionary are named as expected by the function.
Author
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. yes, I agree. I was thinking about a temporal refactoring only. |
||
| ``` | ||
|
|
||
| **Good**: | ||
| ```python | ||
| class Menu: | ||
|
|
||
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.
It's used be called kwargs (keyword arguments) , isn't it?