<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/objbool.c, branch 5.0.0-beta.3</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=5.0.0-beta.3</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=5.0.0-beta.3'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2019-01-15T01:29:19+00:00</updated>
<entry>
<title>py changes for supporting superclass constructors that take kwargs</title>
<updated>2019-01-15T01:29:19+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2019-01-14T23:14:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=72d993d60c5e5238942491df00776ca31f9758a1'/>
<id>urn:sha1:72d993d60c5e5238942491df00776ca31f9758a1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>all: Remove inclusion of internal py header files.</title>
<updated>2017-10-04T01:37:50+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-10-04T01:37:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a3dc1b1957d2c96d7c60c2c629c95077b03488a1'/>
<id>urn:sha1:a3dc1b1957d2c96d7c60c2c629c95077b03488a1</id>
<content type='text'>
Header files that are considered internal to the py core and should not
normally be included directly are:
    py/nlr.h - internal nlr configuration and declarations
    py/bc0.h - contains bytecode macro definitions
    py/runtime0.h - contains basic runtime enums

Instead, the top-level header files to include are one of:
    py/obj.h - includes runtime0.h and defines everything to use the
        mp_obj_t type
    py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h,
        and defines everything to use the general runtime support functions

Additional, specific headers (eg py/objlist.h) can be included if needed.
</content>
</entry>
<entry>
<title>all: Convert mp_uint_t to mp_unary_op_t/mp_binary_op_t where appropriate</title>
<updated>2017-08-29T03:16:30+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-08-29T03:04:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=58321dd9854d71a96e5db2d361e0efc05d9de8cf'/>
<id>urn:sha1:58321dd9854d71a96e5db2d361e0efc05d9de8cf</id>
<content type='text'>
The unary-op/binary-op enums are already defined, and there are no
arithmetic tricks used with these types, so it makes sense to use the
correct enum type for arguments that take these values.  It also reduces
code size quite a bit for nan-boxing builds.
</content>
</entry>
<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/objbool: Make a slight simplification of bool constructor.</title>
<updated>2016-09-30T07:02:07+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-09-30T06:49:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=8de270b4fcd150febff2fa1ce36fb3990ac142e6'/>
<id>urn:sha1:8de270b4fcd150febff2fa1ce36fb3990ac142e6</id>
<content type='text'>
Reduces code size for some archs.
</content>
</entry>
<entry>
<title>py/objbool: Defer bool's unary op implementation to small int.</title>
<updated>2016-09-30T07:02:06+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-09-30T06:46:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=eca1408f16beeeb06e2eb16410545a29b7064f20'/>
<id>urn:sha1:eca1408f16beeeb06e2eb16410545a29b7064f20</id>
<content type='text'>
Similar to how binary op already works.  Common unary operations already
have fast paths for bool so there's no need to have explicit handling of
ops in bool_unary_op, especially since they have the same behaviour as
integers.
</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>
<entry>
<title>py: Change type of .make_new and .call args: mp_uint_t becomes size_t.</title>
<updated>2016-01-11T00:48:41+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-01-03T09:59:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a0c97814dfcb0debbde8be99539e3d5ca2334e54'/>
<id>urn:sha1:a0c97814dfcb0debbde8be99539e3d5ca2334e54</id>
<content type='text'>
This patch changes the type signature of .make_new and .call object method
slots to use size_t for n_args and n_kw (was mp_uint_t.  Makes code more
efficient when mp_uint_t is larger than a machine word.  Doesn't affect
ports when size_t and mp_uint_t have the same size.
</content>
</entry>
<entry>
<title>py: Make UNARY_OP_NOT a first-class op, to agree with Py not semantics.</title>
<updated>2015-12-10T22:19:48+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-12-08T12:28:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=bdbe8c9ae21559f6dc0b8e1ad84b7bbec2a04726'/>
<id>urn:sha1:bdbe8c9ae21559f6dc0b8e1ad84b7bbec2a04726</id>
<content type='text'>
Fixes #1684 and makes "not" match Python semantics.  The code is also
simplified (the separate MP_BC_NOT opcode is removed) and the patch saves
68 bytes for bare-arm/ and 52 bytes for minimal/.

Previously "not x" was implemented as !mp_unary_op(x, MP_UNARY_OP_BOOL),
so any given object only needs to implement MP_UNARY_OP_BOOL (and the VM
had a special opcode to do the ! bit).

With this patch "not x" is implemented as mp_unary_op(x, MP_UNARY_OP_NOT),
but this operation is caught at the start of mp_unary_op and dispatched as
!mp_obj_is_true(x).  mp_obj_is_true has special logic to test for
truthness, and is the correct way to handle the not operation.
</content>
</entry>
<entry>
<title>py: Wrap all obj-ptr conversions in MP_OBJ_TO_PTR/MP_OBJ_FROM_PTR.</title>
<updated>2015-11-29T14:25:35+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-11-27T17:01:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=999cedb90ff0827cdb9dfe0e4faa6ebc1739d271'/>
<id>urn:sha1:999cedb90ff0827cdb9dfe0e4faa6ebc1739d271</id>
<content type='text'>
This allows the mp_obj_t type to be configured to something other than a
pointer-sized primitive type.

This patch also includes additional changes to allow the code to compile
when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of
mp_uint_t, and various casts.
</content>
</entry>
</feed>
