[Patches] [ python-Patches-1669633 ] methods for bytes

SourceForge.net noreply at sourceforge.net
Tue Feb 27 06:35:27 CET 2007

Patches item #1669633, was opened at 2007-02-26 19:04
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core (C code)
Group: Python 3000
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Pete Shinners (shredwheat)
Assigned to: Nobody/Anonymous (nobody)
Summary: methods for bytes

Initial Comment:
This adds the methods for bytes objects as listed in PEP 358. It includes tests for the newly added methods.


>Comment By: Neal Norwitz (nnorwitz)
Date: 2007-02-26 21:35

Logged In: YES 
Originator: NO

Thanks for the patch.

I'd like to try to focus on reviewing only new code.  How much of this
code was copied straight from string, how much was modified and how much
was new?  

There are a bunch of formatting changes.  Could you revert those portions
and add them to a separate patch (the file can be attached here if you

Since you are adding a Fini method, I wonder if you ought to add a
corresponding Init method.  This would init nullbytes and save a comparison
on each instantiation of a bytes object.

_adjust_indices() looks generic, does this code exist elsewhere/can it be

All the methods that take a single argument should use METH_O (e.g.,

Shouldn't value in bytes_remove(), bytes_insert(), and possibly elsewhere
be limited to 0..255?  If the value is > 255, it will traverse the entire
bytes, then raise an exception rather than fail early.


You can respond by visiting: 

More information about the Patches mailing list