Pipe in the "return" statement

Billy Mays 81282ed9a88799d21e77957df2d84bd6514d9af6 at myhashismyemail.com
Mon Jul 25 16:31:43 CEST 2011

On 07/25/2011 10:16 AM, Archard Lias wrote:
> On Jul 25, 2:03 pm, Ian Collins<ian-n... at hotmail.com>  wrote:
>> On 07/26/11 12:00 AM, Archard Lias wrote:
>>> Hi,
>>> Still I dont get how I am supposed to understand the pipe and its task/
>>> idea/influece on control flow, of:
>>> return<statement>    |<statement>
>>> ??
>> It's simply a bitwise OR.
>> --
>> Ian Collins
> Yes, but how does it get determined, which one actually gets returned?

The return statement returns a single value from a function context. 
The pipe operator takes 2 values and bitwise ORs* them together.  That 
result is then returned to the caller.  The pipe character in this 
instance is not the same as in a shell.

* This is not exactly true, but don't worry about it.


More information about the Python-list mailing list