On Wed, Nov 25, 2009 at 2:39 PM, Stefan Behnel <[email protected]> wrote:
>
> 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.
>

Forget about it, my brain is not working well today.


-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to