<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/runtime.c, branch v1.4.5</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.4.5</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.4.5'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2015-06-26T21:40:21+00:00</updated>
<entry>
<title>runtime: Improve mp_import_name() debug logging.</title>
<updated>2015-06-26T21:40:21+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-06-26T21:32:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6557a096d6ee3c0d169617b9bcea5778246232b0'/>
<id>urn:sha1:6557a096d6ee3c0d169617b9bcea5778246232b0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Remove mp_load_const_bytes and instead load precreated bytes object.</title>
<updated>2015-06-25T14:42:13+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-06-25T14:42:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=59fba2d6ea31c134c9c0b88dc73cd25b236f167c'/>
<id>urn:sha1:59fba2d6ea31c134c9c0b88dc73cd25b236f167c</id>
<content type='text'>
Previous to this patch each time a bytes object was referenced a new
instance (with the same data) was created.  With this patch a single
bytes object is created in the compiler and is loaded directly at execute
time as a true constant (similar to loading bignum and float objects).
This saves on allocating RAM and means that bytes objects can now be
used when the memory manager is locked (eg in interrupts).

The MP_BC_LOAD_CONST_BYTES bytecode was removed as part of this.

Generated bytecode is slightly larger due to storing a pointer to the
bytes object instead of the qstr identifier.

Code size is reduced by about 60 bytes on Thumb2 architectures.
</content>
</entry>
<entry>
<title>py: Remove mp_load_const_str and replace uses with inlined version.</title>
<updated>2015-06-25T13:58:41+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-06-25T13:58:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ed570e4b2a0a68e43b191fb0d5b45fb2ec83aca4'/>
<id>urn:sha1:ed570e4b2a0a68e43b191fb0d5b45fb2ec83aca4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Use a wrapper to explicitly check self argument of builtin methods.</title>
<updated>2015-06-20T15:39:39+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-06-19T12:49:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=06593fb0f23dfc12f482561fbec1717dca0d4db4'/>
<id>urn:sha1:06593fb0f23dfc12f482561fbec1717dca0d4db4</id>
<content type='text'>
Previous to this patch a call such as list.append(1, 2) would lead to a
seg fault.  This is because list.append is a builtin method and the first
argument to such methods is always assumed to have the correct type.

Now, when a builtin method is extracted like this it is wrapped in a
checker object which checks the the type of the first argument before
calling the builtin function.

This feature is contrelled by MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG and
is enabled by default.

See issue #1216.
</content>
</entry>
<entry>
<title>py: Add MP_BINARY_OP_DIVMOD to simplify and consolidate divmod builtin.</title>
<updated>2015-06-13T22:36:30+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-06-13T21:00:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=c5029bcbf37fd1a3fb145d9fa9e4a5094478f17b'/>
<id>urn:sha1:c5029bcbf37fd1a3fb145d9fa9e4a5094478f17b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Add stack check to mp_iternext, since it can be called recursively.</title>
<updated>2015-06-03T21:19:41+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-06-03T21:19:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=953c23b1bcc732ccb3a6e4798add9b1f2fc0f444'/>
<id>urn:sha1:953c23b1bcc732ccb3a6e4798add9b1f2fc0f444</id>
<content type='text'>
Eg, builtin map can map over a map, etc, and call iternext deeply.

Addresses issue #1294.
</content>
</entry>
<entry>
<title>py: Convert hash API to use MP_UNARY_OP_HASH instead of ad-hoc function.</title>
<updated>2015-05-12T21:46:02+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-05-11T12:25:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=c2a4e4effc81d8ab21bb014e34355643e5ca0da2'/>
<id>urn:sha1:c2a4e4effc81d8ab21bb014e34355643e5ca0da2</id>
<content type='text'>
Hashing is now done using mp_unary_op function with MP_UNARY_OP_HASH as
the operator argument.  Hashing for int, str and bytes still go via
fast-path in mp_unary_op since they are the most common objects which
need to be hashed.

This lead to quite a bit of code cleanup, and should be more efficient
if anything.  It saves 176 bytes code space on Thumb2, and 360 bytes on
x86.

The only loss is that the error message "unhashable type" is now the
more generic "unsupported type for __hash__".
</content>
</entry>
<entry>
<title>runtime: Add TODO for mp_resume() on handling .close().</title>
<updated>2015-05-09T23:39:45+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-05-09T23:39:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4a60cac9162f8f2aa25a2de4025493d38113ae54'/>
<id>urn:sha1:4a60cac9162f8f2aa25a2de4025493d38113ae54</id>
<content type='text'>
Exceptions in .close() should be ignored (dumped to sys.stderr, not
propagated), but in uPy, they are propagated. Fix would require
nlr-wrapping .close() call, which is expensive. Bu on the other hand,
.close() is not called often, so maybe that's not too bad (depends,
if it's finally called and that causes stack overflow, there's nothing
good in that). And yet on another hand, .close() can be implemented to
catch exceptions on its side, and that should be the right choice.
</content>
</entry>
<entry>
<title>py: iternext() may not return MP_OBJ_NULL, only MP_OBJ_STOP_ITERATION.</title>
<updated>2015-05-09T21:41:49+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-05-09T21:41:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4ed7b7f751b161420e6979927fd0756467a10cb7'/>
<id>urn:sha1:4ed7b7f751b161420e6979927fd0756467a10cb7</id>
<content type='text'>
Testing for incorrect value led to premature termination of generator
containing yield from for such iterator (e.g. "yield from [1, 2]").
</content>
</entry>
<entry>
<title>py: Add %q format support to mp_[v]printf, and use it.</title>
<updated>2015-04-16T14:30:16+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-04-11T12:03:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=044c473de203b4dbe93874813b430fb6336db2b2'/>
<id>urn:sha1:044c473de203b4dbe93874813b430fb6336db2b2</id>
<content type='text'>
</content>
</entry>
</feed>
