mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
py: Allow viper to have type annotations.
Viper functions can now be annotated with the type of their arguments
and return value. Eg:
@micropython.viper
def f(x:int) -> int:
return x + 1
This commit is contained in:
@@ -39,6 +39,12 @@
|
||||
*/
|
||||
#define MP_SCOPE_FLAG_NOFREE 0x40
|
||||
|
||||
// types for native (viper) function signature
|
||||
#define MP_NATIVE_TYPE_OBJ (0x00)
|
||||
#define MP_NATIVE_TYPE_BOOL (0x01)
|
||||
#define MP_NATIVE_TYPE_INT (0x02)
|
||||
#define MP_NATIVE_TYPE_UINT (0x03)
|
||||
|
||||
typedef enum {
|
||||
MP_UNARY_OP_BOOL, // __bool__
|
||||
MP_UNARY_OP_LEN, // __len__
|
||||
|
||||
Reference in New Issue
Block a user