classification
Title: Inconsistent use of buffer interface in string and unicode
Type: enhancement Stage: test needed
Components: Interpreter Core, Unicode Versions: Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, lemburg, nnorwitz, philthompson10
Priority: normal Keywords: patch

Created on 2005-10-25 21:38 by philthompson10, last changed 2010-08-22 00:26 by georg.brandl. This issue is now closed.

Files
File name Uploaded Description Edit
Python-2.4.2-buffer-interface.patch philthompson10, 2005-10-25 21:38 Initial patch
Messages (6)
msg48915 - (view) Author: Phil Thompson (philthompson10) Date: 2005-10-25 21:38
String and unicode objects allow objects that  
implement the buffer interface to be used in  
method arguments where a string is expected in  
most cases - but it's not completely consistent.  
  
Examples where the buffer interface is ignored  
include all the strip methods, the format  
methods, the just methods (for strings but  not 
unicode) and the "in" operator (for strings but not 
unicode). 
 
The attached patch implements the missing 
bits. 
msg48916 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2005-10-31 04:03
Logged In: YES 
user_id=33168

Are there any doc updates necessary?  If so that should be
included in the patch.
Tests need to be added to verify objects that implement the
buffer interface works for all affected code.
msg48917 - (view) Author: Phil Thompson (philthompson10) Date: 2005-10-31 17:24
Logged In: YES 
user_id=1105728

I don't think any doc updates are necessary. Those 
methods that don't need fixing don't have any 
documentation that is specific to objects that 
implement the buffer interface. 
 
Likewise for tests. I couldn't find any existing tests for 
objects that implement the buffer interface - maybe 
because the core doesn't include any objects that 
can be tested. 
msg83926 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2009-03-21 09:45
This looks like a useful addition for Python 2.x - not sure about 3.x,
since that doesn't have the 2.x buffer interface anymore.

Phil, could you update the patch for Python 2.7.
msg84102 - (view) Author: Phil Thompson (philthompson10) Date: 2009-03-24 17:59
Yes I can update the patch, but it might be a while before I get the time.
msg114624 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-08-22 00:26
This won't get applied anymore to 2.x.
History
Date User Action Args
2010-08-22 00:26:31georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg114624

resolution: out of date
2009-03-24 17:59:03philthompson10setmessages: + msg84102
2009-03-21 09:45:30lemburgsetnosy: + lemburg

messages: + msg83926
versions: - Python 3.1
2009-03-20 23:12:16ajaksu2setstage: test needed
type: enhancement
components: + Unicode
versions: + Python 3.1, Python 2.7, - Python 2.4
2005-10-25 21:38:48philthompson10create