summaryrefslogtreecommitdiff
path: root/py/objstr.c
diff options
context:
space:
mode:
authorJohn R. Lenton <jlenton@gmail.com>2014-01-06 00:08:21 +0000
committerJohn R. Lenton <jlenton@gmail.com>2014-01-06 00:08:21 +0000
commita10dba75090b38919790d1c3ad8bb9d2c126b7f4 (patch)
tree6750678d47844bb3918b4012a8af41cd989eeda5 /py/objstr.c
parentba3f87c94776538fece5e87ff1d7de547930397a (diff)
parent8137b004b004d8e3a594eab90afccb72b779273a (diff)
Merge remote-tracking branch 'upstream/master' into list_reverse
Diffstat (limited to 'py/objstr.c')
-rw-r--r--py/objstr.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/py/objstr.c b/py/objstr.c
index a1d139e83..db3e0beca 100644
--- a/py/objstr.c
+++ b/py/objstr.c
@@ -187,14 +187,10 @@ static MP_DEFINE_CONST_FUN_OBJ_VAR(str_format_obj, 1, str_format);
const mp_obj_type_t str_type = {
{ &mp_const_type },
"str",
- str_print, // print
- NULL, // make_new
- NULL, // call_n
- NULL, // unary_op
- str_binary_op, // binary_op
- str_getiter, // getiter
- NULL, // iternext
- { // method list
+ .print = str_print,
+ .binary_op = str_binary_op,
+ .getiter = str_getiter,
+ .methods = {
{ "join", &str_join_obj },
{ "format", &str_format_obj },
{ NULL, NULL }, // end-of-list sentinel
@@ -238,14 +234,8 @@ mp_obj_t str_it_iternext(mp_obj_t self_in) {
static const mp_obj_type_t str_it_type = {
{ &mp_const_type },
"str_iterator",
- NULL, // print
- NULL, // make_new
- NULL, // call_n
- NULL, // unary_op
- NULL, // binary_op
- NULL, // getiter
- str_it_iternext, // iternext
- { { NULL, NULL }, }, // method str
+ .iternext = str_it_iternext,
+ .methods = { { NULL, NULL }, },
};
mp_obj_t mp_obj_new_str_iterator(mp_obj_str_t *str, int cur) {