<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/objstr.h, branch 2.x</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=2.x</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=2.x'/>
<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>all: Unify header guard usage.</title>
<updated>2017-07-18T01:57:39+00:00</updated>
<author>
<name>Alexander Steffen</name>
<email>devel.20.webmeister@spamgourmet.com</email>
</author>
<published>2017-06-29T21:14:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=299bc625864b9e624ed599c94a5f95870516139a'/>
<id>urn:sha1:299bc625864b9e624ed599c94a5f95870516139a</id>
<content type='text'>
The code conventions suggest using header guards, but do not define how
those should look like and instead point to existing files. However, not
all existing files follow the same scheme, sometimes omitting header guards
altogether, sometimes using non-standard names, making it easy to
accidentally pick a "wrong" example.

This commit ensures that all header files of the MicroPython project (that
were not simply copied from somewhere else) follow the same pattern, that
was already present in the majority of files, especially in the py folder.

The rules are as follows.

Naming convention:
* start with the words MICROPY_INCLUDED
* contain the full path to the file
* replace special characters with _

In addition, there are no empty lines before #ifndef, between #ifndef and
one empty line before #endif. #endif is followed by a comment containing
the name of the guard macro.

py/grammar.h cannot use header guards by design, since it has to be
included multiple times in a single C file. Several other files also do not
need header guards as they are only used internally and guaranteed to be
included only once:
* MICROPY_MPHALPORT_H
* mpconfigboard.h
* mpconfigport.h
* mpthreadport.h
* pin_defs_*.h
* qstrdefs*.h
</content>
</entry>
<entry>
<title>py/objstr: Convert mp_uint_t to size_t (and use int) where appropriate.</title>
<updated>2017-02-16T05:51:16+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-02-16T05:26:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=c0d9500eeefe57076f2f9a36afaa80186e9e30be'/>
<id>urn:sha1:c0d9500eeefe57076f2f9a36afaa80186e9e30be</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Be more specific with MP_DECLARE_CONST_FUN_OBJ macros.</title>
<updated>2016-10-21T05:26:01+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-10-18T00:06:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4ebdb1f2b217410cdc1cee0e0c0da8fceb7627f2'/>
<id>urn:sha1:4ebdb1f2b217410cdc1cee0e0c0da8fceb7627f2</id>
<content type='text'>
In order to have more fine-grained control over how builtin functions are
constructed, the MP_DECLARE_CONST_FUN_OBJ macros are made more specific,
with suffix of _0, _1, _2, _3, _VAR, _VAR_BETEEN or _KW.  These names now
match the MP_DEFINE_CONST_FUN_OBJ macros.
</content>
</entry>
<entry>
<title>py: If str/bytes hash is 0 then explicitly compute it.</title>
<updated>2016-09-02T04:49:50+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-09-02T04:42:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=5f3bda422a18d49fb282a93968b658c568343b7d'/>
<id>urn:sha1:5f3bda422a18d49fb282a93968b658c568343b7d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/objstr: Implement str.center().</title>
<updated>2016-05-21T21:13:44+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-05-21T21:13:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=1b5abfcaae0188233415b37dcc0a3df1c7ee0656'/>
<id>urn:sha1:1b5abfcaae0188233415b37dcc0a3df1c7ee0656</id>
<content type='text'>
Disabled by default, enabled in unix port. Need for this method easily
pops up when working with text UI/reporting, and coding workalike
manually again and again counter-productive.
</content>
</entry>
<entry>
<title>py/objarray: Implement "in" operator for bytearray.</title>
<updated>2016-02-14T16:57:11+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-02-14T16:55:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=c38809e26b71c539584462c2d02b6cd2647ade5b'/>
<id>urn:sha1:c38809e26b71c539584462c2d02b6cd2647ade5b</id>
<content type='text'>
</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 signature of builtin funs that take variable or kw args.</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-03T14:21:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4b72b3a133ea87a1ef8b964508dc25c551ccf093'/>
<id>urn:sha1:4b72b3a133ea87a1ef8b964508dc25c551ccf093</id>
<content type='text'>
With this patch the n_args parameter is changed type from mp_uint_t to
size_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>
</feed>
