Gregory P. Smith schrieb:
> Is there anything similar to chr(65) for creating a single byte string
> that doesn't involve creating an intermediate string or tuple object?
> 
>  bytes(chr(65))
>  bytes((65,))
> 
> both seem slightly weird.

b = bytes(1)
b[0] = 65

doesn't create an intermediate string or tuple object.

Regards,
Martin
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to