[Python-porting] six.buffer_types?

Benjamin Peterson benjamin at python.org
Fri Jun 13 07:33:46 CEST 2014
In addition to David said, usually the correct way to use a buffer type
is to call a buffer type (either memoryview or buffer) on some object
that supports the buffer interface. I'm curious what you're using the
list for.

On Wed, May 28, 2014, at 11:01, Shai Berger wrote:
> 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.
> _______________________________________________
> Python-porting mailing list
> Python-porting at python.org
> https://mail.python.org/mailman/listinfo/python-porting


More information about the Python-porting mailing list