Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
8bb71f0b
Commit
8bb71f0b
authored
Oct 30, 2014
by
Paul Sokolovsky
Browse files
moductypes: Make .sizeof() work with bytearrays.
parent
66d08eb4
Changes
1
Hide whitespace changes
Inline
Side-by-side
extmod/moductypes.c
View file @
8bb71f0b
...
...
@@ -263,6 +263,9 @@ STATIC mp_uint_t uctypes_struct_size(mp_obj_t desc_in, mp_uint_t *max_field_size
STATIC
mp_obj_t
uctypes_struct_sizeof
(
mp_obj_t
obj_in
)
{
mp_uint_t
max_field_size
=
0
;
if
(
MP_OBJ_IS_TYPE
(
obj_in
,
&
mp_type_bytearray
))
{
return
mp_obj_len
(
obj_in
);
}
// We can apply sizeof either to structure definition (a dict)
// or to instantiated structure
if
(
MP_OBJ_IS_TYPE
(
obj_in
,
&
uctypes_struct_type
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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