Details
- Reviewers
martinvonz pulkit - Group Reviewers
hg-reviewers - Commits
- rHGa84564b1a0b1: help: check if a subtopic exists and raise an error if it doesn't (issue6145)
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
mercurial/help.py | ||
---|---|---|
689–695 | This made me remember that for-else statement exists. |
mercurial/help.py | ||
---|---|---|
689–695 | I left this as-is because I find for-else statements hard to read (I never remember what it means!) and find this to be clearer even if there's a bit more boilerplate. |
mercurial/help.py | ||
---|---|---|
689–695 | I avoid for-else for the same reason, but how about this: if not any(subtopic in names for names, header, doc in subtopics[name]): raise error.UnknownCommand(name) |
mercurial/help.py | ||
---|---|---|
689–695 | OK, I agree that's clearer. I used _ to match header and doc to make the line a bit shorter and to make it a bit clearer for me to read since those aren't being used. |
mercurial/help.py | ||
---|---|---|
689–695 | This should work but we have _ as a function imported from mercurial.i18n. |
This made me remember that for-else statement exists.