<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/objarray.c, branch 6.0.0</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.0.0</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.0.0'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2020-09-12T19:07:23+00:00</updated>
<entry>
<title>modstruct: Improve compliance with python3</title>
<updated>2020-09-12T19:07:23+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-09-12T18:57:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=54d97251fe2dd4939652a186bf703885e654b4d1'/>
<id>urn:sha1:54d97251fe2dd4939652a186bf703885e654b4d1</id>
<content type='text'>
While checking whether we can enable -Wimplicit-fallthrough, I encountered
a diagnostic in mp_binary_set_val_array_from_int which led to discovering
the following bug:
```
&gt;&gt;&gt; struct.pack("xb", 3)
b'\x03\x03'
```
That is, the next value (3) was used as the value of a padding byte, while
standard Python always fills "x" bytes with zeros.  I initially thought
this had to do with the unintentional fallthrough, but it doesn't.
Instead, this code would relate to an array.array with a typecode of
padding ('x'), which is ALSO not desktop Python compliant:
```
&gt;&gt;&gt; array.array('x', (1, 2, 3))
array('x', [1, 0, 0])
```
Possibly this is dead code that used to be shared between struct-setting
and array-setting, but it no longer is.

I also discovered that the argument list length for struct.pack
and struct.pack_into were not checked, and that the length of binary data
passed to array.array was not checked to be a multiple of the element
size.

I have corrected all of these to conform more closely to standard Python
and revised some tests where necessary.  Some tests for micropython-specific
behavior that does not conform to standard Python and is not present
in CircuitPython was deleted outright.
</content>
</entry>
<entry>
<title>Turn off find when CPYTHON_COMPAT is off</title>
<updated>2020-07-21T22:40:51+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2020-07-21T22:40:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6db10f9c7deba015dc89090f0957ebbd742cfa8e'/>
<id>urn:sha1:6db10f9c7deba015dc89090f0957ebbd742cfa8e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Only add .find without CPYTHON_COMPAT</title>
<updated>2020-07-21T20:08:42+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2020-07-21T20:08:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=900edb2b8e118ff36b708afe65363e5929f00ad8'/>
<id>urn:sha1:900edb2b8e118ff36b708afe65363e5929f00ad8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add cast for mpy-cross warning</title>
<updated>2020-07-18T00:55:06+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2020-07-18T00:55:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=f38a9c8d2991a94df9d629ae33ec25fa32b61af9'/>
<id>urn:sha1:f38a9c8d2991a94df9d629ae33ec25fa32b61af9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add find varients to bytearray</title>
<updated>2020-07-18T00:07:37+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2020-07-16T00:59:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4b157aa6b8d925cbf29ceeb96da3a455f3a77f3b'/>
<id>urn:sha1:4b157aa6b8d925cbf29ceeb96da3a455f3a77f3b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add license to some obvious files.</title>
<updated>2020-07-06T18:16:25+00:00</updated>
<author>
<name>Diego Elio Pettenò</name>
<email>flameeyes@flameeyes.com</email>
</author>
<published>2020-06-03T22:40:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=34b4993d63a6b576f29d624385c681f679b4124c'/>
<id>urn:sha1:34b4993d63a6b576f29d624385c681f679b4124c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Make decode only apply to bytearray and not array as well</title>
<updated>2020-05-15T21:32:44+00:00</updated>
<author>
<name>Thea Flowers</name>
<email>me@thea.codes</email>
</author>
<published>2020-05-15T21:32:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0876034adb8487f45c88224cb1ce29743848244e'/>
<id>urn:sha1:0876034adb8487f45c88224cb1ce29743848244e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add bytearray.decode() for CPython compatibility</title>
<updated>2020-05-15T04:52:58+00:00</updated>
<author>
<name>Thea Flowers</name>
<email>me@thea.codes</email>
</author>
<published>2020-05-15T04:16:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=fe3e8ee02c08e78691ebad293796985c9589824f'/>
<id>urn:sha1:fe3e8ee02c08e78691ebad293796985c9589824f</id>
<content type='text'>
CPython has a `decode()` method on `bytearray`. This adds that method using the code from `bytes.decode`.

Test program:

```python

byte_boi = bytes([0x6D, 0x65, 0x65, 0x70])
print(byte_boi)  # b'meep'
byte_boi_str = byte_boi.decode("utf-8")
print(byte_boi_str)  # meep

byte_array_boi = bytearray(byte_boi)
print(byte_array_boi)  # bytearray(b'meep')
byte_array_boi_str = byte_array_boi.decode("utf-8")
print(byte_array_boi_str)  # meep

print(byte_array_boi_str == byte_boi_str)  # True

```
</content>
</entry>
<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>LocalPeripheral is now Peripheral; more work on basic GATTS support; UART not working yet</title>
<updated>2018-12-31T03:33:49+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2018-12-31T03:31:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=1dc3957e729a7bf4d6476c587f140e3d42fd1bd5'/>
<id>urn:sha1:1dc3957e729a7bf4d6476c587f140e3d42fd1bd5</id>
<content type='text'>
</content>
</entry>
</feed>
