summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-02-08 21:57:19 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-02-08 22:00:20 +0200
commit557c9d52643a6bc6e101f18f59ce0839b0249b21 (patch)
tree7feccdda5b8186234aef0a9856fc50a28c083f44 /py
parent21c51f0bdead583cda2271b6370e65ce3ff53258 (diff)
downloadmicropython-557c9d52643a6bc6e101f18f59ce0839b0249b21.tar.gz
micropython-557c9d52643a6bc6e101f18f59ce0839b0249b21.zip
unix microsocket: Add dummy makefile() method.
Unlike CPython socket, microsocket object already implements stream protocol (read/write methods), so makefile() just returns object itself. TODO: this doesn't take care of arguments CPython's makefile() may accept.
Diffstat (limited to 'py')
-rw-r--r--py/obj.c1
-rw-r--r--py/obj.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/py/obj.c b/py/obj.c
index e21596fdf5..e3e9dbfd55 100644
--- a/py/obj.c
+++ b/py/obj.c
@@ -253,3 +253,4 @@ mp_obj_t mp_obj_len_maybe(mp_obj_t o_in) {
mp_obj_t mp_identity(mp_obj_t self) {
return self;
}
+MP_DEFINE_CONST_FUN_OBJ_1(mp_identity_obj, mp_identity);
diff --git a/py/obj.h b/py/obj.h
index f99bcc40e7..85462b3a8b 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -370,6 +370,7 @@ extern const mp_obj_type_t fun_bc_type;
void mp_obj_fun_bc_get(mp_obj_t self_in, int *n_args, uint *n_state, const byte **code);
mp_obj_t mp_identity(mp_obj_t self);
+MP_DECLARE_CONST_FUN_OBJ(mp_identity_obj);
// super
extern const mp_obj_type_t super_type;