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
This commit is contained in:
stijn
2014-10-04 08:51:33 +02:00
committed by Paul Sokolovsky
parent 072bd07f17
commit 2fe4cf7761
8 changed files with 90 additions and 63 deletions

View File

@@ -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);