Your IP : 216.73.216.213
��Yf� � @ s0 d Z Gd d � d � Z d d � Z e � d S)zA
A demonstration of classes and their special methods in Python.
c @ s� e Z d Z d Z d d � Z e d d � � Z d d � Z d d � Z d
d � Z d d
� Z
d d � Z d d � Z e Z
d S)�Vecaw 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)
c G s t | � | _ d S)N)�list�v)�selfr � r �6/opt/alt/python35/lib64/python3.5/Tools/demo/vector.py�__init__ s zVec.__init__c C s+ t | t � s t � | � } | | _ | S)N)�
isinstancer � TypeErrorr )�clsr Zinstr r r �fromlist"