ANN: Dogelog Runtime, Prolog to the Moon (2021)
Greg Ewing
greg.ewing at canterbury.ac.nz
Fri Sep 17 23:53:25 EDT 2021
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
More information about the Python-list
mailing list