title: __setitem__ implementation in Python for Point(x,y) class
body: <p>I'm trying to make a Point class in python. I already have some of the functions, like __ str__ , or __ getitem__ implemented, and it works great.
  The only problem I'm facing is that my implementation of the __ setitem__ does not work, the others are doing fine.</p>
  
  <p>Here is my Point class, and the last function is my __ setitem__:</p>
  
  <pre><code>class point(object):
      def __init__(self,x=0,y=0):
          self.x=x
          self.y=y
  
      def __str__(self):
          return "point(%s,%s)"%(self.x,self.y)
  
      def __getitem__(self,item):
          return (self.x, self.y)[item]
  
      def __setitem__(self,x,y):
          [self.x, self.y][x]=y
  </code></pre>
  
  <p>it should work like this:</p>
  
  <pre><code>p=point(2,3)
  p[0]=1 #sets the x coordinate to 1
  p[1]=10 #sets the y coordinate to 10
  </code></pre>
  
  <p>(Am I even right, should the setitem work like this?)
  Thanks!</p>