R. David Murray <rdmur...@bitdance.com> added the comment:

A bytearray is for working with mutable data.  We don't support using it in all 
places that the non-mutable data types can be used.  You can code your example 
like this:

   barr.center(len(barr) * 4, bytes([barr[-1]]))

I realize that isn't particularly pretty, but that has more to do with the fact 
that indexing bytes gives you ints in Python 3 than it does with whether or not 
bytearray is accepted.

The data type of the arguments to the method have no necessary relationship 
with the datatype of the object.

You may have more success arguing that the fill character for both bytearray 
and bytes should be allowed to be an int.

I think this whole topic is better addressed in a forum such as python-ideas.  
I agree that the bytes interface is a bit wonky in places, but I think that if 
changes are going to be made a consensus needs to be developed on what changes 
to make.  I believe some conversations about this have already taken place, and 
so far I don't think there are any consensus proposals.

So, I'm going to close this issue.  But please join (or start, if necessary) 
the discussion on this wider topic in the appropriate forum.

----------
resolution:  -> rejected
stage:  -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12380>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to