Pipe character in Python

alwbtc picture alwbtc · May 13, 2011 · Viewed 58.5k times · Source

I see a "pipe" character (|) used in a function call:

res = c1.create(go, come, swim, "", startTime, endTime, "OK", ax|bx)

What is the meaning of the pipe in ax|bx?

Answer

gui11aume picture gui11aume · Mar 4, 2012

This is also the union set operator

set([1,2]) | set([2,3])

This will result in set([1, 2, 3])