-
Notifications
You must be signed in to change notification settings - Fork 7k
changing description and example to add more clarification #322
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
Conversation
add more clarification
"add more clarification" PR description is misleading. You change example itself.
Please take these comments just as an opinion and a ground for discussion. |
patterns/behavioral/command.py
Outdated
A simple command to bold a text. | ||
""" | ||
|
||
def execute(self): |
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.
To show the effect of the command it is good to have some definition of bold. Maybe in this case wrap the text with the HTML <b>
or <strong>
element. The same goes for italic.
Hi guys! |
def rename(self, src, dest): | ||
print("renaming {} to {}".format(src, dest)) | ||
os.rename(src, dest) | ||
def on_do_press(self, filename): |
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.
I think names like on_do_press
and on_undo_press
are harder to read then rename
, delete
or whatever else
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.
You are right, but the invoker (here is the menu item) does not know what is going to do.
Am I right?
Can we think of example without actual os files manipulations? Deleting files is a bit dangerous and not really necessary here. |
add more clarification