[Python-ideas] except expression

David Mertz mertz at gnosis.cx
Fri Feb 21 07:42:46 CET 2014


While I'm growing to like the '->' operator, at least better than the colon
that just looks wrong to me; I would defend Chris' characterization of it
as "new."  That is, the symbols exist as function annotations already, but
the current use is not as an *operator*, so that's technically true.


On Thu, Feb 20, 2014 at 4:10 PM, Steven D'Aprano <steve at pearwood.info>wrote:

> On Wed, Feb 19, 2014 at 10:55:58PM -0500, Yury Selivanov wrote:
> >
> > On 2/19/2014, 8:18 PM, Chris Angelico wrote:
> > >Advantages of the arrow include ->
> > I would refrain from introducing a new operator here,
> > especially '->'.
>
> It's not new. It's used in annotations:
>
> py> def func(a, b) -> "Return result":
> ...     return "something"
> ...
> py> func.__annotations__
> {'return': 'Return result'}
>
>
> --
> Steven
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>



-- 
Keeping medicines from the bloodstreams of the sick; food
from the bellies of the hungry; books from the hands of the
uneducated; technology from the underdeveloped; and putting
advocates of freedom in prisons.  Intellectual property is
to the 21st century what the slave trade was to the 16th.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140220/adb224fa/attachment.html>


More information about the Python-ideas mailing list