Skip to content

Instantly share code, notes, and snippets.

@exarkun
Created January 3, 2017 17:31
Show Gist options
  • Save exarkun/ab3dc368832548462984d7db2f2bd183 to your computer and use it in GitHub Desktop.
Save exarkun/ab3dc368832548462984d7db2f2bd183 to your computer and use it in GitHub Desktop.
(txaws) exarkun@baryon:~/Work/LeastAuthority/txaws$ cat /tmp/frozenwhat.py
import attr
@attr.s(frozen=True)
class Base(object):
a = attr.ib()
@attr.s
class Derived(Base):
b = attr.ib()
Derived("a", "b")
(txaws) exarkun@baryon:~/Work/LeastAuthority/txaws$ python /tmp/frozenwhat.py
Traceback (most recent call last):
File "/tmp/frozenwhat.py", line 12, in <module>
Derived("a", "b")
File "<attrs generated init ceb0d1d1d54ce44d01f6dd968d2fb57e3b4d0016>", line 2, in __init__
File "/home/exarkun/Environments/txaws/local/lib/python2.7/site-packages/attr/_make.py", line 201, in _frozen_setattrs
raise FrozenInstanceError()
attr.exceptions.FrozenInstanceError
(txaws) exarkun@baryon:~/Work/LeastAuthority/txaws$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment