News for hackers. Stuff that matters.
Re:PEP 3107 – Function Annotations in Python 3 by ak217 on Monday May 12, 2014 @07:42AM (#7732141)
I've added a type checking decorator for function annotations to my assertions helper library, https://github.com/kislyuk/ensure:

    from ensure import ensure_annotations

    @ensure_annotations
    def f(x: int, y: float) -> float:
        return x+y

    f(1, 2.3)
    >>> 3.3
    f(1, 2)
    >>> ensure.EnsureError: Argument y to <function f at 0x109b7c710> does not match annotation type <class 'float'>
It's useful sometimes.
Re:PEP 3107 – Function Annotations in Python 3 by thomasahle on Monday May 12, 2014 @08:57AM (#7732412)
How does that work? Is it abusing dictionary syntax without braces?
Re:PEP 3107 – Function Annotations in Python 3 by ak217 on Monday May 12, 2014 @09:34AM (#7732559)
The PEP describes it nicely :)

I'm not a huge fan of the "->" syntax myself, but I'm not sure what would work better.