mathialo / bython

Python with braces. Because python is awesome, but whitespace is awful.
MIT License
2.1k stars 50 forks source link

C-style Type Declaration #51

Open Willie169 opened 3 months ago

Willie169 commented 3 months ago

It will be easier for users from C/C++ to use type hint of Python if Bython supports the conversion from C-style type declaration to Python type hint. For example: C-style type declaration:

int add(int x, int y) {
    return x + y;
}

Python type hint:

def add(x: int, y: int) -> int:
    return x + y
ViktorPopp commented 2 months ago

But that would basically make a C interpreter.

Willie169 commented 2 months ago

I've made PR that solve pass problem, add C-style comments and type declarations. https://github.com/mathialo/bython/pull/55