î ¼ê[ë#ã4@ssdZddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4g4Zd5d6lmZd7d%„Zd8d"„Zd9d „Zd:d)„Zd;d „Z d<d „Z d=d+„Z d>d3„Z d?d„Z d@d„ZdAd„ZdBd„ZdCd„ZdDd „ZdEd„ZdFd„ZeZdGd$„ZdHd'„ZdId(„ZdJd*„ZdKd,„ZdLd-„ZdMd.„ZdNd/„ZdOd1„ZdPd2„ZdQd4„ZdRd„Z dSd„Z!dTd„Z"dUd„Z#dVd „Z$dWd„Z%dXd0„Z&d5dYd#„Z'GdZd„dƒZ(Gd[d„dƒZ)Gd\d&„d&ƒZ*d]d„Z+d^d„Z,d_d„Z-d`d„Z.dad„Z/dbd„Z0dcd„Z1ddd„Z2ded„Z3dfd„Z4dgd„Z5dhd „Z6did!„Z7yd5djl8TWne9k r\YnXd5dkl8mZeZ:eZ;eZ<eZ=e Z>e Z?e Z@eZAeZBeZCeZDeZEeZFeZGeZHeZIeZJeZKeZLeZMeZNeZOeZPeZQeZRe ZSe!ZTe#ZUe$ZVe&ZWe+ZXe,ZYe-ZZe.Z[e/Z\e0Z]e1Z^e2Z_e3Z`e4Zae5Zbe6Zce7ZddlS)mas Operator Interface This module exports a set of functions corresponding to the intrinsic operators of Python. For example, operator.add(x, y) is equivalent to the expression x+y. The function names are those used for special methods; variants without leading and trailing '__' are also provided for convenience. This is the pure Python implementation of the module. ÚabsÚaddÚand_Ú attrgetterÚconcatÚcontainsÚcountOfÚdelitemÚeqÚfloordivÚgeÚgetitemÚgtÚiaddÚiandÚiconcatÚ ifloordivÚilshiftÚimodÚimulÚindexÚindexOfÚinvÚinvertÚiorÚipowÚirshiftÚis_Úis_notÚisubÚ itemgetterÚitruedivÚixorÚleÚ length_hintÚlshiftÚltÚ methodcallerÚmodÚmulÚneÚnegÚnot_Úor_ÚposÚpowÚrshiftÚsetitemÚsubÚtruedivÚtruthÚxoré)rcCs ||kS)zSame as a < b.©)ÚaÚbr6r6ú/usr/lib/python3.4/operator.pyr%scCs ||kS)zSame as a <= b.r6)r7r8r6r6r9r"scCs ||kS)zSame as a == b.r6)r7r8r6r6r9r #scCs ||kS)zSame as a != b.r6)r7r8r6r6r9r)'scCs ||kS)zSame as a >= b.r6)r7r8r6r6r9r +scCs ||kS)zSame as a > b.r6)r7r8r6r6r9r /scCs| S)zSame as not a.r6)r7r6r6r9r+5scCs|r dSdS)z*Return True if a is true, False otherwise.TFr6)r7r6r6r9r39scCs ||kS)zSame as a is b.r6)r7r8r6r6r9r=scCs ||k S)zSame as a is not b.r6)r7r8r6r6r9rAscCs t|ƒS)zSame as abs(a).)Ú_abs)r7r6r6r9rGscCs||S)zSame as a + b.r6)r7r8r6r6r9rKscCs||@S)zSame as a & b.r6)r7r8r6r6r9rOscCs||S)zSame as a // b.r6)r7r8r6r6r9r SscCs |jƒS)zSame as a.__index__().)Ú __index__)r7r6r6r9rWscCs|S)z Same as ~a.r6)r7r6r6r9r[scCs||>S)zSame as a << b.r6)r7r8r6r6r9r$`scCs||S)zSame as a % b.r6)r7r8r6r6r9r'dscCs||S)zSame as a * b.r6)r7r8r6r6r9r(hscCs| S)z Same as -a.r6)r7r6r6r9r*lscCs||BS)zSame as a | b.r6)r7r8r6r6r9r,pscCs| S)z Same as +a.r6)r7r6r6r9r-tscCs||S)zSame as a ** b.r6)r7r8r6r6r9r.xscCs||?S)zSame as a >> b.r6)r7r8r6r6r9r/|scCs||S)zSame as a - b.r6)r7r8r6r6r9r1€scCs||S)zSame as a / b.r6)r7r8r6r6r9r2„scCs||AS)zSame as a ^ b.r6)r7r8r6r6r9r4ˆscCs9t|dƒs1dt|ƒj}t|ƒ‚n||S)z%Same as a + b, for a and b sequences.Ú __getitem__z!'%s' object can't be concatenated)ÚhasattrÚtypeÚ__name__Ú TypeError)r7r8Úmsgr6r6r9rŽscCs ||kS)z(Same as b in a (note reversed operands).r6)r7r8r6r6r9r•scCs4d}x'|D]}||kr |d7}q q W|S)z)Return the number of times b occurs in a.r5ér6)r7r8ÚcountÚir6r6r9r™s   cCs ||=dS)zSame as del a[b].Nr6)r7r8r6r6r9r¡scCs||S)z Same as a[b].r6)r7r8r6r6r9r ¥scCs=x6t|ƒD]\}}||kr |Sq Wtdƒ‚dS)z!Return the first index of b in a.z$sequence.index(x): x not in sequenceN)Ú enumerateÚ ValueError)r7r8rDÚjr6r6r9r©s cCs|||= 0. z/'%s' object cannot be interpreted as an integerz'__length_hint__ must be integer, not %sr5z$__length_hint__() should return >= 0) Ú isinstanceÚintr>r?r@ÚlenÚ__length_hint__ÚAttributeErrorÚNotImplementedrF)ÚobjÚdefaultrAZhintÚvalr6r6r9r#µs4        c@s.eZdZdZdd„Zdd„ZdS)raV Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter('name'), the call f(r) returns r.name. After g = attrgetter('name', 'date'), the call g(r) returns (r.name, r.date). After h = attrgetter('name.first', 'name.last'), the call h(r) returns (r.name.first, r.name.last). csŒ|sQt|tƒs$tdƒ‚n|jdƒ‰‡fdd†}||_n7ttt|f|ƒƒ‰‡fdd†}||_dS)Nzattribute name must be a stringÚ.cs$xˆD]}t||ƒ}qW|S)N)Úgetattr)rOÚname)Únamesr6r9Úfuncës z!attrgetter.__init__..funccst‡fdd†ˆDƒƒS)Nc3s|]}|ˆƒVqdS)Nr6)Ú.0Úgetter)rOr6r9ú ósz4attrgetter.__init__..func..)Útuple)rO)Úgetters)rOr9rVòs)rIÚstrr@ÚsplitÚ_callrZÚmapr)ÚselfÚattrZattrsrVr6)r[rUr9Ú__init__æs zattrgetter.__init__cCs |j|ƒS)N)r^)r`rOr6r6r9Ú__call__öszattrgetter.__call__N)r?Ú __module__Ú __qualname__Ú__doc__rbrcr6r6r6r9rÞs  c@s.eZdZdZdd„Zdd„ZdS)rzØ Return a callable object that fetches the given item(s) from its operand. After f = itemgetter(2), the call f(r) returns r[2]. After g = itemgetter(2, 5, 3), the call g(r) returns (r[2], r[5], r[3]) csPˆs$‡fdd†}||_n(ˆfˆ‰‡fdd†}||_dS)Ncs|ˆS)Nr6)rO)Úitemr6r9rVsz!itemgetter.__init__..funccst‡fdd†ˆDƒƒS)Nc3s|]}ˆ|VqdS)Nr6)rWrD)rOr6r9rYsz4itemgetter.__init__..func..)rZ)rO)Úitems)rOr9rVs)r^)r`rgrhrVr6)rgrhr9rbÿs   zitemgetter.__init__cCs |j|ƒS)N)r^)r`rOr6r6r9rc szitemgetter.__call__N)r?rdrerfrbrcr6r6r6r9rùs  c@s.eZdZdZdd„Zdd„ZdS)r&zö Return a callable object that calls the given method on its operand. After f = methodcaller('name'), the call f(r) returns r.name(). After g = methodcaller('name', 'date', foo=1), the call g(r) returns r.name('date', foo=1). cOs^t|ƒdkr'd}t|ƒ‚n|d}|d|_|dd…|_||_dS)Néz9methodcaller needs at least one argument, the method namer5rB)rKr@Ú_nameÚ_argsÚ_kwargs)ÚargsÚkwargsrAr`r6r6r9rbs  zmethodcaller.__init__cCst||jƒ|j|jŽS)N)rSrjrkrl)r`rOr6r6r9rcszmethodcaller.__call__N)r?rdrerfrbrcr6r6r6r9r& s  cCs||7}|S)zSame as a += b.r6)r7r8r6r6r9r#s cCs||M}|S)zSame as a &= b.r6)r7r8r6r6r9r(s cCs?t|dƒs1dt|ƒj}t|ƒ‚n||7}|S)z&Same as a += b, for a and b sequences.r<z!'%s' object can't be concatenated)r=r>r?r@)r7r8rAr6r6r9r-s  cCs||}|S)zSame as a //= b.r6)r7r8r6r6r9r5s cCs||K}|S)zSame as a <<= b.r6)r7r8r6r6r9r:s cCs||;}|S)zSame as a %= b.r6)r7r8r6r6r9r?s cCs||9}|S)zSame as a *= b.r6)r7r8r6r6r9rDs cCs||O}|S)zSame as a |= b.r6)r7r8r6r6r9rIs cCs||C}|S)zSame as a **= b.r6)r7r8r6r6r9rNs cCs||L}|S)zSame as a >>= b.r6)r7r8r6r6r9rSs cCs||8}|S)zSame as a -= b.r6)r7r8r6r6r9rXs cCs||}|S)zSame as a /= b.r6)r7r8r6r6r9r ]s cCs||N}|S)zSame as a ^= b.r6)r7r8r6r6r9r!bs )Ú*)rfN)erfÚ__all__Úbuiltinsrr:r%r"r r)r r r+r3rrrrr rrrr$r'r(r*r,r-r.r/r1r2r4rrrrr rr0r#rrr&rrrrrrrrrrrr r!Ú _operatorÚ ImportErrorÚ__lt__Ú__le__Ú__eq__Ú__ne__Ú__ge__Ú__gt__Ú__not__Ú__abs__Ú__add__Ú__and__Ú __floordiv__r;Ú__inv__Ú __invert__Ú __lshift__Ú__mod__Ú__mul__Ú__neg__Ú__or__Ú__pos__Ú__pow__Ú __rshift__Ú__sub__Ú __truediv__Ú__xor__Ú __concat__Ú __contains__Ú __delitem__r<Ú __setitem__Ú__iadd__Ú__iand__Ú __iconcat__Ú __ifloordiv__Ú __ilshift__Ú__imod__Ú__imul__Ú__ior__Ú__ipow__Ú __irshift__Ú__isub__Ú __itruediv__Ú__ixor__r6r6r6r9Ú sÚ                                  )