diff options
| author | Jason Madden <jamadden@gmail.com> | 2020-04-07 07:56:48 -0500 |
|---|---|---|
| committer | Jason Madden <jamadden@gmail.com> | 2020-04-07 07:56:48 -0500 |
| commit | c500360aaba5db30e5005664d14659ed7d8186ec (patch) | |
| tree | ea2515835357faff9c80b952b546df0f1cc4fd6f /src/zope/interface/declarations.py | |
| parent | a404e5fed4766625b564de558942dd4efd979e89 (diff) | |
| download | zope-interface-issue204.tar.gz | |
The ImmutableDeclaration also has immutable _v_attrs.issue204
Fixes #204
Diffstat (limited to 'src/zope/interface/declarations.py')
| -rw-r--r-- | src/zope/interface/declarations.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/zope/interface/declarations.py b/src/zope/interface/declarations.py index b42c906..d77c824 100644 --- a/src/zope/interface/declarations.py +++ b/src/zope/interface/declarations.py @@ -195,6 +195,18 @@ class _ImmutableDeclaration(Declaration): # object, and that includes a method.) return _ImmutableDeclaration + @property + def _v_attrs(self): + # _v_attrs is not a public, documented property, but some client + # code uses it anyway as a convenient place to cache things. To keep + # the empty declaration truly immutable, we must ignore that. That includes + # ignoring assignments as well. + return {} + + @_v_attrs.setter + def _v_attrs(self, new_attrs): + pass + ############################################################################## # |
