[Python-ideas] [Python-3000] PEP 3107 Function Annotations: overloadable ->

Tony Lownds tony at pagedna.com
Tue Jan 2 04:28:07 CET 2007


On Jan 1, 2007, at 5:39 PM, Josiah Carlson wrote:

> Given a reading of version 53169 of PEP 3107, I see no reason to even
> offer a __returns__ attribute, automatic method call, etc.  PEP 3107
> already defines the annotation to be specified as a dictionary of  
> named
> argument names, with a key of 'return' for the annotation of the  
> return
> annotation.  Is there any reason why this isn't sufficient?
>
> Even in the context of the signature PEP 362, there is no need for
> __returns__, as an annotation-consuming library would check the
> signature object for argument annotations, and the func_annotations
> dictionary for the 'return' key for any return annotations.

Something got lost in the movement between lists... __returns__ wasn't
going to supplant or alter func_annotations or PEP 362 in any way.

__returns__ was proposed as the special method attached to a new
operator (->). That operator could be used to write expressions that  
look
like a function signature.

Here's Kay's original email.

http://mail.python.org/pipermail/python-list/2007-January/420774.html

-Tony




More information about the Python-ideas mailing list