diff options
author | stijn <stinos@zoho.com> | 2014-10-04 08:51:33 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-10-21 22:10:01 +0300 |
commit | 2fe4cf7761ffc40d81b4780d59c2b6ef0a5c16ff (patch) | |
tree | a959cd20a8f4458861a3589f9d179225609ffc19 /py | |
parent | 072bd07f178998f2c88cd2ceef86dea7902a1764 (diff) | |
download | micropython-2fe4cf7761ffc40d81b4780d59c2b6ef0a5c16ff.tar.gz micropython-2fe4cf7761ffc40d81b4780d59c2b6ef0a5c16ff.zip |
Implement kwargs for builtin open() and _io.FileIO
This makes open() and _io.FileIO() more CPython compliant.
The mode kwarg is fully iplemented.
The encoding kwarg is allowed but not implemented; mainly to allow
the tests to specify encoding for CPython, see #874
Diffstat (limited to 'py')
-rw-r--r-- | py/builtin.h | 2 | ||||
-rw-r--r-- | py/qstrdefs.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/py/builtin.h b/py/builtin.h index 01ec22d2b0..a69712bec7 100644 --- a/py/builtin.h +++ b/py/builtin.h @@ -25,7 +25,7 @@ */ mp_obj_t mp_builtin___import__(mp_uint_t n_args, mp_obj_t *args); -mp_obj_t mp_builtin_open(mp_uint_t n_args, const mp_obj_t *args); +mp_obj_t mp_builtin_open(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwargs); MP_DECLARE_CONST_FUN_OBJ(mp_builtin___build_class___obj); MP_DECLARE_CONST_FUN_OBJ(mp_builtin___import___obj); diff --git a/py/qstrdefs.h b/py/qstrdefs.h index 2c2c45b5be..c10b2fabac 100644 --- a/py/qstrdefs.h +++ b/py/qstrdefs.h @@ -446,6 +446,9 @@ Q(StringIO) Q(BytesIO) Q(getvalue) Q(file) +Q(mode) +Q(r) +Q(encoding) #endif #if MICROPY_PY_GC |