ok

Mini Shell

Direktori : /proc/thread-self/root/lib64/python2.7/Demo/classes/
Upload File :
Current File : //proc/thread-self/root/lib64/python2.7/Demo/classes/Vec.pyc

�
��^c@s'ddd��YZd�Ze�dS(tVeccBsbeZdZd�Zed��Zd�Zd�Zd�Zd�Z	d�Z
d�ZeZRS(	sx A simple vector class

    Instances of the Vec class  can be constructed from numbers

    >>> a = Vec(1, 2, 3)
    >>> b = Vec(3, 2, 1)

    added
    >>> a + b
    Vec(4, 4, 4)

    subtracted
    >>> a - b
    Vec(-2, 0, 2)

    and multiplied by a scalar on the left
    >>> 3.0 * a
    Vec(3.0, 6.0, 9.0)

    or on the right
    >>> a * 3.0
    Vec(3.0, 6.0, 9.0)
    cGst|�|_dS(N(tlisttv(tselfR((s(/usr/lib64/python2.7/Demo/classes/Vec.pyt__init__scCs.t|t�st�n|�}||_|S(N(t
isinstanceRt	TypeErrorR(tclsRtinst((s(/usr/lib64/python2.7/Demo/classes/Vec.pytfromlists
			cCs)djd�|jD��}dj|�S(Ns, css|]}t|�VqdS(N(trepr(t.0tx((s(/usr/lib64/python2.7/Demo/classes/Vec.pys	<genexpr>%ssVec({0})(tjoinRtformat(Rtargs((s(/usr/lib64/python2.7/Demo/classes/Vec.pyt__repr__$scCs
t|j�S(N(tlenR(R((s(/usr/lib64/python2.7/Demo/classes/Vec.pyt__len__(scCs|j|S(N(R(Rti((s(/usr/lib64/python2.7/Demo/classes/Vec.pyt__getitem__+scCs?gt|j|j�D]\}}||^q}tj|�S(N(tzipRRR	(RtotherRtyR((s(/usr/lib64/python2.7/Demo/classes/Vec.pyt__add__.s2cCs?gt|j|j�D]\}}||^q}tj|�S(N(RRRR	(RRRRR((s(/usr/lib64/python2.7/Demo/classes/Vec.pyt__sub__3s2cCs-g|jD]}||^q
}tj|�S(N(RRR	(RtscalarRR((s(/usr/lib64/python2.7/Demo/classes/Vec.pyt__mul__8s (
t__name__t
__module__t__doc__RtclassmethodR	RRRRRRt__rmul__(((s(/usr/lib64/python2.7/Demo/classes/Vec.pyRs							cCsddl}|j�dS(Ni����(tdoctestttestmod(R!((s(/usr/lib64/python2.7/Demo/classes/Vec.pyttest@sN((RR#(((s(/usr/lib64/python2.7/Demo/classes/Vec.pyt<module>s?	

Zerion Mini Shell 1.0