[Python-3000] Does bytes() need to support bytes(<str>, <encoding>)?

Barry Warsaw barry at python.org
Wed Aug 29 22:03:31 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Aug 28, 2007, at 11:21 AM, Guido van Rossum wrote:

>> Nope.  So what would bytes(s) do?
>
> Raise TypeError (when s is a str). The argument to bytes() must be
> either an int (then it creates a zero-filled bytes bytes array of that
> length) or an iterable of ints (then it creates a bytes array
> initialized with those ints -- if any int is out of range, an
> exception is raised, and also if any value is not an int).

+1
- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iQCVAwUBRtXRFHEjvBPtnXfVAQLY+gP9HsP7Va5ZNdBLEO/yeOU+AQwmjyR+ei4Y
KqRK6PNV+7dOGUPeExgfvZhmKoPmu11Q6EYQMFcCFN1/2xb/OooQYaSrT4nI6P3J
eNxfmYrUu4H49myygC1IezswJWuestJi3KLawS8MFdLUqphQloH5QfZLBQsRIV8/
m2x3CVXfOrY=
=bO41
-----END PGP SIGNATURE-----


More information about the Python-3000 mailing list