Python interpreter error: unsupported operand type(s) for |:

Discussion in 'Python' started by yaffa, Aug 11, 2005.

  1. yaffa

    yaffa Guest

    hey folks i get this error: Python interpreter error: unsupported operand
    type(s) for |:

    when i run this line of code:

    for incident in bs('tr', {'bgcolor' : '#eeeeee'} | {'bgcolor' :
    'white'} ):

    any idea what i'm doing wrong here?

    thanks

    yaffa
    yaffa, Aug 11, 2005
    #1
    1. Advertising

  2. you cannot use | with two dict (dict has no .__or__ method)

    what are you trying to do?
    Szabolcs Nagy, Aug 11, 2005
    #2
    1. Advertising

  3. Szabolcs Nagy a écrit :
    > you cannot use | with two dict (dict has no .__or__ method)
    >
    > what are you trying to do?
    >

    read the post: "need help with python syntax"...
    (posted one hour sooner)
    Bruno Desthuilliers, Aug 11, 2005
    #3
  4. yaffa a écrit :
    > hey folks i get this error: Python interpreter error: unsupported
    > operand type(s) for |:
    >
    > when i run this line of code:
    >
    > for incident in bs('tr', {'bgcolor' : '#eeeeee'} | {'bgcolor' :
    > 'white'} ):
    >
    > any idea what i'm doing wrong here?


    yes: trying to do a bitwise or of two dict objects.


    > thanks


    You're welcome.
    Bruno Desthuilliers, Aug 11, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Martin Koekenberg
    Replies:
    3
    Views:
    1,311
    Martin Koekenberg
    Aug 26, 2004
  2. Brett C.
    Replies:
    2
    Views:
    2,852
    Martin Koekenberg
    Aug 30, 2004
  3. Rakesh
    Replies:
    3
    Views:
    6,306
    Rakesh
    Mar 30, 2005
  4. Jay Parlar
    Replies:
    0
    Views:
    793
    Jay Parlar
    Mar 17, 2006
  5. Florian Lindner
    Replies:
    1
    Views:
    637
Loading...

Share This Page