[Python-ideas] Conventions for function annotations

Robert McGibbon rmcgibbo at gmail.com
Mon Dec 3 10:41:15 CET 2012


The IPython community has thought of using annotations to do argument specific
tab completion in the interactive interpreter.

For example, a load function whose first argument is supposed to be files matching 
a certain glob pattern might use a function annotation on that argument to specify
the glob pattern.

A sympy maintainer, Aaron Meurer,  has also expressed interest in using this feature
-- as implemented in ipython -- to annotate sympy functions' return values by type
to facilitate tab completion for chained calls like f(x).<TAB>

I'm working on this feature for IPython (PR: Function annotation based hooks into the tab completion system).
I've already benefited a lot from the discussion on this thread in terms of the design
of the API. Specifically Nick Coghlan's arguments have been very enlightening.
Comments, suggestions, contributions, etc are welcome!

-Robert


On Dec 3, 2012, at 1:30 AM, Paul Moore wrote:

> Sorry, should have gone to the list
> 
> On 3 December 2012 09:30, Paul Moore <p.f.moore at gmail.com> wrote:
>> On 3 December 2012 09:21, Antoine Pitrou <solipsis at pitrou.net> wrote:
>>> In short, we have discovered that declarative typing isn't very
>>> useful :-)
>> 
>> .. but haven't thought of any other useful applications of
>> annotations, and nor has the collective community on PyPI.
>> 
>> Annotations seem like a solution looking for a problem, to me. (Which
>> is a shame, as they look like a pretty cool solution)
>> Paul
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121203/259c6fe9/attachment.html>


More information about the Python-ideas mailing list