Pipe in the "return" statement

Archard Lias archardlias at googlemail.com
Mon Jul 25 11:05:35 EDT 2011


On Jul 25, 4:35 pm, Oliver Bestwalter <oli... at bestwalter.de> wrote:
> Hello Archard,
>
> On 25.07.2011, at 16:16, 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?
>
> You do a Bitwise OR with numbers. Your statements are both returning numbers and those are combined with a bitwise OR. Combining b0001 with b0010 results in 0011 for example, you can see this very often done in C Code to set and check flags. Here is a gentle introduction:
>
> http://www.codeproject.com/KB/tips/Binary_Guide.aspxhttp://www.codepr...
>
> Cheers
> Oliver

Oh!, never gave it a thought about the fact that what I was looking at
where flags... Thank you very much for the link, is a great
introduction to something I had not known before.



More information about the Python-list mailing list