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

Y

yaffa

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
 
S

Szabolcs Nagy

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

what are you trying to do?
 
B

Bruno Desthuilliers

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)
 
B

Bruno Desthuilliers

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.


You're welcome.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top