[Python-porting] six.buffer_types?

Shai Berger shai at platonix.com
Wed May 28 20:01:17 CEST 2014


Hi Python porters,

This is my first message here; usually, I work on Django. In this work, I 
recently felt the need to have a collection of the buffer, or bytes types 
(parallel to the existing string_types) for an isinstance check. That is,

if six.PY2:
	buffer_types = buffer, bytearray
if six.PY3:
	buffer_types = bytes, bytearray, memoryview

We will probably add this soon to Django's customized version of six (the 
initial PR is at https://github.com/django/django/pull/2732/files if you're 
interested).

Do you think this would be useful for six in general?

Thanks,
	Shai.


More information about the Python-porting mailing list