Skip to content
  • Paul Sokolovsky's avatar
    py/stream: Implement 2- and 3-arg write() method as an extension to CPython. · ad9b9c76
    Paul Sokolovsky authored
    3-arg form:
    
    stream.write(data, offset, length)
    
    2-arg form:
    
    stream.write(data, length)
    
    These allow efficient buffer writing without incurring extra memory
    allocation for slicing or creating memoryview() object, what is
    important for low-memory ports.
    
    All arguments must be positional. It might be not so bad idea to standardize
    on 3-arg form, but 2-arg case would need check and raising an exception
    anyway then, so instead it was just made to work.
    ad9b9c76