469,646 Members | 1,322 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,646 developers. It's quick & easy.

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

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

Aug 11 '05 #1
3 2691
you cannot use | with two dict (dict has no .__or__ method)

what are you trying to do?

Aug 11 '05 #2
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)
Aug 11 '05 #3
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.

Aug 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

20 posts views Thread by Lucas Raab | last post: by
34 posts views Thread by Ville Voipio | last post: by
12 posts views Thread by ozbear | last post: by
5 posts views Thread by Allerdyce.John | last post: by
852 posts views Thread by Mark Tarver | last post: by
9 posts views Thread by fahadqureshi | last post: by
reply views Thread by Lie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.