diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-08-15 16:45:41 +0100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-08-15 16:45:41 +0100 |
| commit | 2ac4af6946543ae96cf3659468e1b8cabb057f85 (patch) | |
| tree | 2e19460fec67666259afe529e7f4dff71b6451cf /py/obj.h | |
| parent | 6be0b0a8ec9a6badc601190ccee876755ce7efb7 (diff) | |
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
Diffstat (limited to 'py/obj.h')
| -rw-r--r-- | py/obj.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -378,6 +378,7 @@ mp_obj_t mp_obj_new_exception_args(const mp_obj_type_t *exc_type, uint n_args, c mp_obj_t mp_obj_new_exception_msg(const mp_obj_type_t *exc_type, const char *msg); mp_obj_t mp_obj_new_exception_msg_varg(const mp_obj_type_t *exc_type, const char *fmt, ...); // counts args by number of % symbols in fmt, excluding %%; can only handle void* sizes (ie no float/double!) mp_obj_t mp_obj_new_fun_bc(uint scope_flags, qstr *args, uint n_pos_args, uint n_kwonly_args, mp_obj_t def_args, mp_obj_t def_kw_args, const byte *code); +mp_obj_t mp_obj_new_fun_viper(uint n_args, void *fun, mp_uint_t type_sig); mp_obj_t mp_obj_new_fun_asm(uint n_args, void *fun); mp_obj_t mp_obj_new_gen_wrap(mp_obj_t fun); mp_obj_t mp_obj_new_closure(mp_obj_t fun, uint n_closed, const mp_obj_t *closed); |
