Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,19 @@ def create_menu(title, body, button_text, cancellable):
# ...
```

**Light and good**
```python
kargs = {

Copy link
Copy Markdown

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?

'arg0': 'Hello',
'arg1': 'World',
}

def myfunction(arg0, arg1):
print(f'arg0:{arg0} arg1:{arg1}')

myfunction(**kargs)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The 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:
Expand Down