Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wrote a similar python typechecker some time ago (https://github.com/cabalamat/ulib/blob/master/debugdec.md). My syntax is somewhat less verbose so this:

    @returns(int)
    @params(a=int, b=int)
    def add(a, b):
        return a + b
becomes:

    @typ(int, int, ret=int)
    def add(a, b):
        return a + b
I was inspired to do it like that by Haskell's very clean type syntax.

Senko's version has the advantage that you can compose types in it, e.g. {str:int} is a dictionary whose keys are strings and values are integers.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: