On 16/09/21 6:13 am, Mostowski Collapse wrote:
So in Python I now do the following:
peek = kb.get(functor, NotImplemented)
if peek is not NotImplemented:
If you're able to use None instead of NotImplemented, you
could simplify that to
peek = kb.get(functor)
if peek:
...
But if get() in Python is implemented under the hood with
exception handling. ... then Python get() will probably be quite slow.
No, it doesn't use exceptions as far as I know. It should
be fairly fast.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list