Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
285683d2
Commit
285683d2
authored
May 11, 2014
by
Paul Sokolovsky
Browse files
objboundmeth: If detailed reporting enabled, print object content.
Similar to closure and cell.
parent
7aca1cae
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/objboundmeth.c
View file @
285683d2
...
...
@@ -39,6 +39,17 @@ typedef struct _mp_obj_bound_meth_t {
mp_obj_t
self
;
}
mp_obj_bound_meth_t
;
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_DETAILED
STATIC
void
bound_meth_print
(
void
(
*
print
)(
void
*
env
,
const
char
*
fmt
,
...),
void
*
env
,
mp_obj_t
o_in
,
mp_print_kind_t
kind
)
{
mp_obj_bound_meth_t
*
o
=
o_in
;
print
(
env
,
"<bound_method %p "
,
o
);
mp_obj_print_helper
(
print
,
env
,
o
->
self
,
PRINT_REPR
);
print
(
env
,
"."
);
mp_obj_print_helper
(
print
,
env
,
o
->
meth
,
PRINT_REPR
);
print
(
env
,
">"
);
}
#endif
mp_obj_t
bound_meth_call
(
mp_obj_t
self_in
,
uint
n_args
,
uint
n_kw
,
const
mp_obj_t
*
args
)
{
mp_obj_bound_meth_t
*
self
=
self_in
;
...
...
@@ -65,6 +76,9 @@ mp_obj_t bound_meth_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj_
const
mp_obj_type_t
bound_meth_type
=
{
{
&
mp_type_type
},
.
name
=
MP_QSTR_bound_method
,
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_DETAILED
.
print
=
bound_meth_print
,
#endif
.
call
=
bound_meth_call
,
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment