title: AttributeError: 'C' object attribute 'y' is read-only when using slots
body: <p>I'm playing a bit with slots and I've come across one thing. I have the following code</p>
  <pre><code>class C(object):
      __slots__ = ('x',)
      def __init__(self, v):
          self.x = v
      y = 123
  
  c = C(5)
  c.y = 12
  </code></pre>
  <p>When I run the code I get the following error</p>
  <pre><code>AttributeError: 'C' object attribute 'y' is read-only
  </code></pre>
  <p>I'm not sure if my explanation for this behavior is correct:
  since 'y' is not a valid instance variable (only 'x' is valid -&gt; slots), the class dictionary is searched for the key 'y' (lookup chain). Since it has type 'mappingproxy' it is unchangeable and the value can not be set.
  Without using slots the expression <code>c.y = 12</code> causes an entry in the object's dictionary, which is why I don't get the error without using slots.</p>