<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/objexcept.c, branch v1.9.2</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.9.2</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.9.2'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2017-07-31T08:35:40+00:00</updated>
<entry>
<title>all: Use the name MicroPython consistently in comments</title>
<updated>2017-07-31T08:35:40+00:00</updated>
<author>
<name>Alexander Steffen</name>
<email>devel.20.webmeister@spamgourmet.com</email>
</author>
<published>2017-06-30T07:22:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=55f33240f3d7051d4213629e92437a36f1fac50e'/>
<id>urn:sha1:55f33240f3d7051d4213629e92437a36f1fac50e</id>
<content type='text'>
There were several different spellings of MicroPython present in comments,
when there should be only one.
</content>
</entry>
<entry>
<title>py: Optimise types for common case where type has a single parent type.</title>
<updated>2017-04-12T03:22:21+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-04-06T02:09:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=816413e4b20ccd463321558458bb63c310712bca'/>
<id>urn:sha1:816413e4b20ccd463321558458bb63c310712bca</id>
<content type='text'>
The common cases for inheritance are 0 or 1 parent types, for both built-in
types (eg built-in exceptions) as well as user defined types.  So it makes
sense to optimise the case of 1 parent type by storing just the type and
not a tuple of 1 value (that value being the single parent type).

This patch makes such an optimisation.  Even though there is a bit more
code to handle the two cases (either a single type or a tuple with 2 or
more values) it helps reduce overall code size because it eliminates the
need to create a static tuple to hold single parents (eg for the built-in
exceptions).  It also helps reduce RAM usage for user defined types that
only derive from a single parent.

Changes in code size (in bytes) due to this patch:

    bare-arm:       -16
    minimal (x86): -176
    unix (x86-64): -320
    unix nanbox:   -384
    stmhal:         -64
    cc3200:         -32
    esp8266:       -108
</content>
</entry>
<entry>
<title>py: Make sure that static emg-exc-buffer is aligned to size of mp_obj_t.</title>
<updated>2017-04-10T06:02:56+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-04-10T06:02:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ee86de1f1a22c45548bc39916fcd2b72dd26ebca'/>
<id>urn:sha1:ee86de1f1a22c45548bc39916fcd2b72dd26ebca</id>
<content type='text'>
This buffer is used to allocate objects temporarily, and such objects
require that their underlying memory be correctly aligned for their data
type.  Aligning for mp_obj_t should be sufficient for emergency exceptions,
but in general the memory buffer should aligned to the maximum alignment of
the machine (eg on a 32-bit machine with mp_obj_t being 4 bytes, a double
may not be correctly aligned).

This patch fixes a bug for certain nan-boxing builds, where mp_obj_t is 8
bytes and must be aligned to 8 bytes (even though the machine is 32 bit).
</content>
</entry>
<entry>
<title>py/objexcept: Convert mp_uint_t to size_t where appropriate.</title>
<updated>2017-02-16T05:51:17+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-02-16T05:38:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=fa5a591757569136a444715cce2248b63ad73512'/>
<id>urn:sha1:fa5a591757569136a444715cce2248b63ad73512</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/objexcept: Replace if-cond and assert(0) with simple assert.</title>
<updated>2017-01-17T06:03:16+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-01-17T06:03:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=5bea080737ee4a22e2a99aa03743cdf4b6396b7d'/>
<id>urn:sha1:5bea080737ee4a22e2a99aa03743cdf4b6396b7d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/objexcept: Allow clearing traceback with 'exc.__traceback__ = None'.</title>
<updated>2016-11-13T23:29:09+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-11-13T23:23:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=c3d96d387c461c25ca3298dfa73d2a4efb45f1e7'/>
<id>urn:sha1:c3d96d387c461c25ca3298dfa73d2a4efb45f1e7</id>
<content type='text'>
We allow 'exc.__traceback__ = None' assignment as a low-level optimization
of pre-allocating exception instance and raising it repeatedly - this
avoids memory allocation during raise. However, uPy will keep adding
traceback entries to such exception instance, so before throwing it,
traceback should be cleared like above.

'exc.__traceback__ = None' syntax is CPython compatible. However, unlike
it, reading that attribute or setting it to any other value is not
supported (and not intended to be supported, again, the only reason for
adding this feature is to allow zero-memalloc exception raising).
</content>
</entry>
<entry>
<title>py/objexcept: Don't convert errno to str in constructor, do it in print.</title>
<updated>2016-05-12T13:27:52+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-05-12T13:27:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=9a9249964155f333131bbd728ffc755e80dc68a2'/>
<id>urn:sha1:9a9249964155f333131bbd728ffc755e80dc68a2</id>
<content type='text'>
OSError's are now printed like:

    OSError: [Errno 1] EPERM

but only if the string corresponding to the errno is found.
</content>
</entry>
<entry>
<title>py: Add mp_errno_to_str() and use it to provide nicer OSError msgs.</title>
<updated>2016-05-12T12:20:40+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-05-12T12:20:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d45e5f8c357d13e66aeac644e2b5ead8c734025f'/>
<id>urn:sha1:d45e5f8c357d13e66aeac644e2b5ead8c734025f</id>
<content type='text'>
If an OSError is raised with an integer argument, and that integer
corresponds to an errno, then the string for the errno is used as the
argument to the exception, instead of the integer.  Only works if
the uerrno module is enabled.
</content>
</entry>
<entry>
<title>py: add async/await/async for/async with syntax</title>
<updated>2016-04-13T14:26:38+00:00</updated>
<author>
<name>pohmelie</name>
<email>multisosnooley@gmail.com</email>
</author>
<published>2016-01-27T20:23:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=81ebba7e0236163b7594938201bf3a6b802ebfaa'/>
<id>urn:sha1:81ebba7e0236163b7594938201bf3a6b802ebfaa</id>
<content type='text'>
They are sugar for marking function as generator, "yield from"
and pep492 python "semantically equivalents" respectively.

@dpgeorge was the original author of this patch, but @pohmelie made
changes to implement `async for` and `async with`.
</content>
</entry>
<entry>
<title>py: Change first arg of type.make_new from mp_obj_t to mp_obj_type_t*.</title>
<updated>2016-01-11T00:49:27+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-01-03T15:55:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=5b3f0b7f39bd67cc9182993c288f09f67a0890df'/>
<id>urn:sha1:5b3f0b7f39bd67cc9182993c288f09f67a0890df</id>
<content type='text'>
The first argument to the type.make_new method is naturally a uPy type,
and all uses of this argument cast it directly to a pointer to a type
structure.  So it makes sense to just have it a pointer to a type from
the very beginning (and a const pointer at that).  This patch makes
such a change, and removes all unnecessary casting to/from mp_obj_t.
</content>
</entry>
</feed>
