Re: The ** operator ambiguous?

2007-07-17 Thread Duncan Booth
Paul Boddie <[EMAIL PROTECTED]> wrote: > However, this ambiguous usage of * and ** is one thing I don't recall > appearing on any of the "Python warts" lists It is true that the same punctuation character is used in more than one context, but that is also true for many other punctuation character

Re: The ** operator ambiguous?

2007-07-16 Thread Paul Boddie
Robert Dailey wrote: > I noticed that the ** operator is used as the power operator, however > I've seen it used when passing variables into a function. Others have already pointed out the relevant documentation. However, this ambiguous usage of * and ** is one thing I don't recall appearing on an

Re: The ** operator ambiguous?

2007-07-16 Thread Klaas
On Jul 16, 10:40 am, Robert Dailey <[EMAIL PROTECTED]> wrote: > I noticed that the ** operator is used as the power operator, however > I've seen it used when passing variables into a function. For example, > I was researching a way to combine dictionaries. I found that if you > do this: > > a = {"

Re: The ** operator ambiguous?

2007-07-16 Thread Gabriel Genellina
En Mon, 16 Jul 2007 14:40:14 -0300, Robert Dailey <[EMAIL PROTECTED]> escribió: > I noticed that the ** operator is used as the power operator, however > I've seen it used when passing variables into a function. For example, > I was researching a way to combine dictionaries. I found that if you

Re: The ** operator ambiguous?

2007-07-16 Thread Duncan Booth
Robert Dailey <[EMAIL PROTECTED]> wrote: > However, I have no idea what the > ** operator is here. I know that when you specify ** as a parameter in > a function definition, it represents a dictionary of parameters passed > in. However, in this example it is NOT being used in a function > definiti

Re: The ** operator ambiguous?

2007-07-16 Thread Diez B. Roggisch
Robert Dailey schrieb: > I noticed that the ** operator is used as the power operator, however > I've seen it used when passing variables into a function. For example, > I was researching a way to combine dictionaries. I found that if you > do this: > > a = {"t1":"a", "t2":"b"} > b = {"t3":"c"} >

Re: The ^ operator

2005-09-26 Thread Steve Holden
Tuvas wrote: > What exactly does the ^ operator do? I've seen, for example, that > 3^4=7, 3^5=8. but 3^3=0. Is it just adding them together if they are > not equal, and if they are equal, outputs 0, or what? Thanks! > ^ is the "bit XOR" operation. It treats its left and right operands as binary

Re: The ^ operator

2005-09-26 Thread Tuvas
Thanks alot! That sure makes lots of sense! -- http://mail.python.org/mailman/listinfo/python-list

Re: The ^ operator

2005-09-26 Thread Peter Hansen
Tuvas wrote: > What exactly does the ^ operator do? I've seen, for example, that > 3^4=7, 3^5=8. but 3^3=0. Is it just adding them together if they are > not equal, and if they are equal, outputs 0, or what? Thanks! It performs an "exclusive-OR" (XOR) operation on the binary data corresponding to