Lisandro Dalcin, 25.11.2009 17:23: > On Wed, Nov 25, 2009 at 9:04 AM, Stefan Behnel wrote: >> bytes(5) is not str(5): >> >> Python 3.1.1 (r311:74480, Oct 22 2009, 19:34:26) >> [GCC 4.3.2] on linux2 >> Type "help", "copyright", "credits" or "license" for more information. >> >>> bytes(5) >> b'\x00\x00\x00\x00\x00' >> >>> str(5) >> '5' >> >> That's one of the differences between the Py2.6 bytes/str type and the >> 'real' Py3.x bytes type. > > Just other thing we should workaround to alleviate users from the > diferences? So bytes(n) would give at b"\0"*n in both Py2/Py3 ?
Would you really want to backport the 'bytes' type to Py2.x? There's much more to it than just the constructor. Think of indexing and iteration, for example, which return integers, not substrings. Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
