#54 scalar == vector error messages

feature request
open-later
3
2003-07-04
2002-02-08
Bruce Sherwood
No

The following test routine shows problems with
comparing vectors with scalars:

R = vector(1,2,3)
if R == 3: # no error message!
print 'a'
if 3 == R: # RuntimeError: Extension object missing a
required method.
print 'b'

Getting no error message or getting an unintelligible
one -- both unsatisfactory.

Discussion

  • Logged In: YES
    user_id=676765

    'if (R==3):' works correctly. Dynamic typing is at work here.
    R clearly is not equal to '3', and the return value of the
    expression is false (0).

    Relational comparisons with a vector as the left operand and
    a scalar as the right operand will be supported in Visual 3.0

     
    • priority: 5 --> 3
    • assigned_to: nobody --> jbrandmeyer
    • status: open --> open-later