[IronPython] unsupported operand type(s) for & operator overloading.

Seo Sanghyeon sanxiyn at gmail.com
Wed May 13 05:28:27 CEST 2009


2009/5/13 李兵 <dreamwinterlb at gmail.com>:
> IronPython expression like this ' A.Create("Audit") ==  A.Create("Test1") &
> A.CreateProperty("Sum") == A.Create("Test2") '

This is a rare pitfall. In C (and C#), == has higher precedence than
&, but in Python, & has higher precedence than ==. So IronPython is
complaining that it can't process A.Create("Test1") &
A.CreateProperty("Sum").

Probably you meant (A.Create("Audit") == A.Create("Test1")) &
(A.CreateProperty("Sum") == A.Create("Test2"))?

-- 
Seo Sanghyeon



More information about the Ironpython-users mailing list