You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For legacy reasons, Limnoria includes its own definition of any() which clashes with the Python builtins. This is pretty confusing at times because we do from supybot.commands import *
Worse, the Supybot version has completely different semantics so expected uses of the builtin just throw non-descriptive errors:
>>> supybot.commands.any([0,''])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/dist-packages/limnoria-2023.4.27-py3.9.egg/supybot/commands.py", line 962, in __init__
self.__parent.__init__(spec)
File "/usr/local/lib/python3.9/dist-packages/limnoria-2023.4.27-py3.9.egg/supybot/commands.py", line 906, in __init__
assert isinstance(spec, context)
AssertionError
Because supybot.commands.any takes a context and the builtin takes an iterable, it should be easy to route between the two different uses. So my idea for cleaning this up would be as follows:
Rename supybot.commands.any to supybot.commands.anyArguments (or whatever name is suggested)
Replace supybot.commands.any with a new definition that instantiates/calls supybot.commands.any if given a context (but raises a deprecation warning), and otherwise passes on the call to the builtins version
(Eventually) remove the old supybot.commands.any link
The text was updated successfully, but these errors were encountered:
For legacy reasons, Limnoria includes its own definition of
any()
which clashes with the Python builtins. This is pretty confusing at times because we dofrom supybot.commands import *
Worse, the Supybot version has completely different semantics so expected uses of the builtin just throw non-descriptive errors:
Because
supybot.commands.any
takes acontext
and the builtin takes an iterable, it should be easy to route between the two different uses. So my idea for cleaning this up would be as follows:supybot.commands.any
tosupybot.commands.anyArguments
(or whatever name is suggested)supybot.commands.any
with a new definition that instantiates/callssupybot.commands.any
if given a context (but raises a deprecation warning), and otherwise passes on the call to the builtins versionsupybot.commands.any
linkThe text was updated successfully, but these errors were encountered: