Per the PEP 8 Style Guide, the preferred way to compare something to None is the pattern if Cond is None. This seems not to work with Libreoffice 6.1.0.3 (x64) for windows.
This code works:
> if minValue == None:
pass
else:
if result < minValue:
result = minValue
But this does not:
> if minValue is None:
> pass
> else:
> if result < minValue:
> result = minValue
When running the code in an IDE outside Libreoffice the “is None” code works and the “== None” yields a warning (based on PEP 8) such as:
“This inspection highlights comparisons with None. That type of comparisons should always be done with ‘is’ or ‘is not’, never the equality operators.”
It took me a good while to figure this one out and one of the reasons I post this question is to point the issue out so that some one else might get help if they are stuck.
Anyone knows why LibreOffice Python behaves like this?
Thanks,
Peter