[Zope-dev] Python3 and attribute annotations.

Martijn Pieters mj at zopatista.com
Mon Mar 9 18:03:10 EDT 2009


On Mon, Mar 9, 2009 at 22:20, Dan Korostelev <nadako at gmail.com> wrote:
> As you may know, python 3 introduced the concept of annotations for
> callable objects. That annotations store information about arguments
> and return values, which is kinda nice language feature that will
> allow us to do interesting things.
>
> But there's a problem: those annotations will be stored in object's
> __annotations__ attribute, which is also used by zope.annotation's
> AttributeAnnotation implementation, so they will conflict.

I don't think they are, according to PEP 3107 they are stored in the
func_annotations attribute of the function.

Note that even if the name *where* the same, attribute annotations
only work on classes and instances, while function annotations only
apply to functions, not?

-- 
Martijn Pieters


More information about the Zope-Dev mailing list