From e9a43d014ca488de0c0778155c31f89a5e424b59 Mon Sep 17 00:00:00 2001 From: Collin Winter Date: Fri, 5 Jan 2007 16:59:58 +0000 Subject: [PATCH] Clarify that the annotation dictionaries are mutable --- pep-3107.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pep-3107.txt b/pep-3107.txt index 0eefa0644..609f44c2c 100644 --- a/pep-3107.txt +++ b/pep-3107.txt @@ -161,8 +161,8 @@ Accessing Function Annotations Once compiled, a function's annotations are available via the function's ``func_annotations`` attribute. This attribute is -a dictionary, mapping parameter names to an object representing -the evaluated annotation expression +a mutable dictionary, mapping parameter names to an object +representing the evaluated annotation expression There is a special key in the ``func_annotations`` mapping, ``"return"``. This key is present only if an annotation was supplied @@ -184,9 +184,9 @@ The ``return`` key was chosen because it cannot conflict with the name of a parameter; any attempt to use ``return`` as a parameter name would result in a ``SyntaxError``. -``func_annotations`` is an empty dictionary if no there are no -annotations on the function. ``func_annotations`` is always an empty -dictionary for functions created from ``lambda`` expressions. +``func_annotations`` is an empty, mutable dictionary if there are no +annotations on the function or if the functions was created from +a ``lambda`` expression. Use Cases =========