Hi ironpython,

Here's your Daily Digest of new issues for project "IronPython".

In today's digest:ISSUES

1. [New issue] bool value conversion malfunctions with Iron python libraries

----------------------------------------------

ISSUES

1. [New issue] bool value conversion malfunctions with Iron python libraries
http://ironpython.codeplex.com/workitem/33181
User SriharshaVardhan has proposed the issue:

"I am finding an issue with iron python libraries while passing a boolean value

Say I have python code "booltest.py" like below.

if ip_bool is not True and ip_bool is not False :
    print "invalid ip_bool"
    
And when I call it using Iron Python libraries

ScriptEngine engine = Python.CreateEngine();
ScriptScope scope = engine.CreateScope();

scope.SetVariable("ip_bool", false);
scope = engine.ExecuteFile("booltest.py", scope);

this results in printing 'invalid ip_bool' though its value is set to false

Further I updated "booltest.py" to test type and print more info
===============================================
print "Before conversion"
print "class :" + ip_bool.__class__.__name__
print "value " + str(ip_bool)

print "ip_bool is not True # " + str(ip_bool is not True)
print "ip_bool is not False # " + str(ip_bool is not False)

ip_bool1 = bool(ip_bool)
print "\nAfter conversion"
print "class :" + ip_bool1.__class__.__name__
print "value " + str(ip_bool1)

print "ip_bool is not True # " + str(ip_bool1 is not True)
print "ip_bool is not False # " + str(ip_bool1 is not False)
===============================================

and it yields

================================
Before conversion
class :bool
value False
ip_bool is not True # True
ip_bool is not False # True

After conversion
class :bool
value False
ip_bool is not True # True
ip_bool is not False # False
================================

Thus passing a bool value from scripting libraries malfunctions"
----------------------------------------------



----------------------------------------------
You are receiving this email because you subscribed to notifications on 
CodePlex.

To report a bug, request a feature, or add a comment, visit IronPython Issue 
Tracker. You can unsubscribe or change your issue notification settings on 
CodePlex.com.
_______________________________________________
Ironpython-users mailing list
Ironpython-users@python.org
http://mail.python.org/mailman/listinfo/ironpython-users

Reply via email to