3 ms·
Wait, so like this? def add(x: int, y: int) -> int: """ // c code int x, y return x + y """ And it compiles it and
by kortex 4y ago
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.
- eru 4y agoThat might be a worthwhile addition to the suggestion at https://github.com/faster-cpython/ideas/issues/453 https://github.com/faster-cpython/ideas/issues/453
- BiteCode_dev 4y agoCombined with the cog (https://nedbatchelder.com/code/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.