zopefoundation / zope.annotation

Mechanism for storing additional information about objects without modifying their classes
Other
1 stars 8 forks source link

Reach 100% coverage. #7

Closed jamadden closed 7 years ago

jamadden commented 7 years ago

Fixes #2.

The most notable feature is that AttributeAnnotations is now always a subclass of collections.MutableMixin. Previously this was different for Python 2 and Python 3. This change unifies the behaviour and makes things like isinstance(annotations, collections.Mapping) always true (previously only true on Python 3).

Also make some of the methods of AttributeAnnotations more consistent with what the underlying storage does, instead of doing things differently when no annotations are found.

jamadden commented 7 years ago

Thanks!

Incidentally, the change to AttributeAnnotations also makes it a new-style class on Python 2, which is notably faster to create than the old DictMixin class (399ns vs 553ns).