code: def write(self, value):
          
          if hasattr(value, '__iter__'):
              bytearray(value)
              self.extend(value)
          else:
              bytearray([value])
              self.append(value)
docs: Appends bytes flat to the deque. So iterables will be unpacked.