We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8bc751 commit 760ef06Copy full SHA for 760ef06
abacus.py
@@ -106,13 +106,19 @@ def command(*args):
106
return command
107
108
109
+def _install_command(name, function):
110
+ if name in globals():
111
+ raise ValueError(f'duplicate name: {name}')
112
+ globals()[name] = function
113
+ __all__.append(name)
114
+
115
116
def _install_commands():
117
for name, aliases in _commands.items():
- globals()[name] = _make_command(name)
- __all__.append(name)
118
+ new_command = _make_command(name)
119
+ _install_command(name, new_command)
120
for alias in aliases:
- globals()[alias] = globals()[name]
- __all__.append(alias)
121
+ _install_command(alias, new_command)
122
123
124
_install_commands()
0 commit comments