summaryrefslogtreecommitdiffstatshomepage
path: root/py/builtinevex.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-10-30 02:43:53 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-10-30 03:50:23 +0200
commit2559e1395700caa3d3ffd21f3f9178d0b90004bf (patch)
treeaf0d14b86c71b558f962edcbb82e85f3c61186d6 /py/builtinevex.c
parentb1422de12f0f0556c845ab029c5077d9a69a8314 (diff)
downloadmicropython-2559e1395700caa3d3ffd21f3f9178d0b90004bf.tar.gz
micropython-2559e1395700caa3d3ffd21f3f9178d0b90004bf.zip
moductypes: Make sure we can apply .sizeof() to all aggregate types.
Before, sizeof() could be applied to a structure field only if that field was itself a structure. Now it can be applied to PTR and ARRAY fields too. It's not possible to apply it to scalar fields though, because as soon as scalar field (int or float) is dereferenced, its value is converted into Python int/float value, and all original type info is lost. Moreover, we allow sizeof of type definitions too, and there int is used to represent (scalar) types. So, we have ambiguity what int may be - either dereferenced scalar structure field, or encoded scalar type. So, rather throw an error if user tries to apply sizeof() to int.
Diffstat (limited to 'py/builtinevex.c')
0 files changed, 0 insertions, 0 deletions