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

Wait, so like this?

    def add(x: int, y: int) -> int:
        """ // c code
            int x, y
            return x + y
        """
And it compiles it and turns it into a C extension?

That's...horrifying yet amazing.



That might be a worthwhile addition to the suggestion at https://github.com/faster-cpython/ideas/issues/453


Combined with the cog (https://nedbatchelder.com/code/cog) to have the c declaration in a proper separate c file, but included in the docstring, you could have the best of both worlds.




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

Search: