Python Operator Summary


Table B.14 represents the complete set of Python operators and to which standard types they apply. The operators are sorted from highest-to-lowest precedence, with those sharing the same shaded group having the same priority.

Table B.14. Python Operators ( - unary)

Operator[a]

int[b]

long

float

complex

str

list

tuple

dict

set, frozenset[c]

[]

    

  

[:]

    

  

**

     

+

     

-

     

~

       

*

  

/

     

//

     

%

    

+

  

-

    

<<

       

>>

       

&

      

^

      

|

      

<

>

<=

>=

==

!=

<>

is

is not

in

    

 

not in

    

 

not

and

or


[a] May also include corresponding augmented assignment operators.

[b] Operations involving Boolean types will be performed on the operands as ints.

[c] (Both) set types new in Python 2.4.



Core Python Programming
Core Python Programming (2nd Edition)
ISBN: 0132269937
EAN: 2147483647
Year: 2004
Pages: 334
Authors: Wesley J Chun

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net