This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: bytes() constructor
Type: enhancement Stage:
Components: Interpreter Core Versions: Python 3.0
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, gvanrossum, loewis
Priority: normal Keywords:

Created on 2007-10-31 09:50 by christian.heimes, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
py3k_pystring_ssize.patch christian.heimes, 2007-10-31 12:49
Messages (4)
msg56990 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-10-31 09:50
Hey Guido!

During my testing and local modifications of the PEP 3137 branch I found
a bunch of unit tests that were choking on bytes(1) where bytes is PyString.

The PEP doesn't list bytes(<int>) as a valid constructor, only
buffer(<int>). I don't see a reason why bytes() shouldn't accept an int
when b'1' still creates a byte sequence with 3 elements. Here is a patch
msg56993 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-10-31 12:44
Where is the patch?
msg56994 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-10-31 12:49
Here it is.

patch + unit test
msg56997 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-10-31 16:41
Committed revision 58730.
Thanks!

PS. Christian, please work with Neal or Martin to get developer
privileges...
History
Date User Action Args
2022-04-11 14:56:27adminsetgithub: 45706
2007-10-31 16:41:43gvanrossumsetstatus: open -> closed
resolution: accepted
messages: + msg56997
2007-10-31 12:49:00christian.heimessetfiles: + py3k_pystring_ssize.patch
messages: + msg56994
2007-10-31 12:44:03loewissetnosy: + loewis
messages: + msg56993
2007-10-31 09:50:10christian.heimescreate