Skip to content
Snippets Groups Projects
Select Git revision
  • 8e701604d570d8c45da95ced677ef999fb4c48a6
  • wip-bootstrap default
  • dualcore
  • ch3/leds
  • ch3/time
  • master
6 results

pyb.UART.rst

Blame
  • bytearray_add.py 278 B
    # test bytearray + bytearray
    
    b = bytearray(2)
    b[0] = 1
    b[1] = 2
    print(b + bytearray(2))
    
    # inplace add
    b += bytearray(3)
    print(b)
    
    # extend
    b.extend(bytearray(4))
    print(b)
    
    # this inplace add tests the code when the buffer doesn't need to be increased
    b = bytearray()
    b += b''