Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python interpreter error: unsupported operand type(s) for |:

Reply
Thread Tools

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

 
 
yaffa
Guest
Posts: n/a
 
      08-11-2005
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

 
Reply With Quote
 
 
 
 
Szabolcs Nagy
Guest
Posts: n/a
 
      08-11-2005
you cannot use | with two dict (dict has no .__or__ method)

what are you trying to do?

 
Reply With Quote
 
 
 
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      08-11-2005
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)
 
Reply With Quote
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      08-11-2005
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: TypeError: unsupported operand type(s) for -: 'tuple' and 'tuple' Jay Parlar Python 0 03-17-2006 02:58 AM
Python interpreter error: unsupported operand type(s) for -: 'tuple' and 'int' Rakesh Python 3 03-30-2005 02:36 PM
Re: TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' Brett C. Python 2 08-30-2004 10:25 PM
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' Martin Koekenberg Python 3 08-26-2004 12:04 PM
Unsupported error,& Right operand of "Divide" operator must be a power of 2.. Kim JM VHDL 1 04-02-2004 06:58 PM



Advertisments