Python phun

Garth Kidd writes:

It turns out that if you define __slots__, and make assignments to attributes in the class definition, they're read-only as far as instances of that class are concerned.

Which I would think means one can't do as follows, but it seems to work:

>>> class Foo:
...   a = "quux"
...   __slots__ = ("a")
...   def setA(self, newa):
...     Foo.a = newa
...
>>> f = Foo()
>>> f.a
'quux'
>>> f.setA("blah")
>>> f.a
'blah'
>>> Foo.a
'blah'
>>> f.a = "quuuux"
>>> f.a
'quuuux'
>>> Foo.a
'blah'

Maybe that's new in the newest bleeding edge version? I only have 2.2c1 still.