Add a comment above the Dictionary Dispatch call
This commit is contained in:
1 parent
363379b2c2
commit
1fde37bb91
1 file changed
+4
@@ -715,6 +715,10 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
|
||||
|
||||
confirm(cfg)
|
||||
|
||||
# Dictionary dispatch: map each mode name to its handler function (the values
|
||||
# are the functions themselves -- no parentheses), look up the one for `mode`,
|
||||
# then call it with (cfg). Equivalent to an if/elif chain over `mode`. `mode`
|
||||
# is always one of these three keys by now, so the lookup can't KeyError.
|
||||
{"cdm": cdm_profile, "slog": slog_profile, "dd": dd_profile}[mode](cfg)
|
||||
return 0
|
||||
|
||||
|
||||
Reference in new issue
Block a user