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
We have python embedded in C# and are putting into scope objects that have Nullable<Decimal> properties and running (user provided python) code which tests for null(None). This fails when the property has a value and we compare the value to None using the == and != operators. It appears to work when we use the pythonic syntax not x or x is not None. We have upgraded from 2.5.2 to 3.0.3, also went from from Python 3.8 to 3.12. This code worked in previous versions.
## This does not workx=Noneprint(x==None)
x=System.Decimal(1.23)
print(x==None)
## This worksx=Noneprint(notx)
x=System.Decimal(1.23)
print(notx)
## This also worksx=Noneprint(xisnotNone)
x=System.Decimal(1.23)
print(xisnotNone)
If there was a crash, please include the traceback here.
Environment
Details
We have python embedded in C# and are putting into scope objects that have
Nullable<Decimal>
properties and running (user provided python) code which tests fornull
(None
). This fails when the property has a value and we compare the value toNone
using the==
and!=
operators. It appears to work when we use the pythonic syntaxnot x
orx is not None
. We have upgraded from2.5.2
to3.0.3
, also went from from Python3.8
to3.12
. This code worked in previous versions.The text was updated successfully, but these errors were encountered: