[Python-ideas] Direct byte<->int conversions (was Re: bitwise operations on bytes)

Mark Dickinson dickinsm at gmail.com
Tue Aug 25 16:25:23 CEST 2009


[Nick Coghlan]
> What would we be converting them to in that case? 2.x strings? (I don't
> have a problem with that, just pointing out there may be some additional
> work due to changing the target type).

Yes, the 2.x 'str' type.  I haven't thought about whether this could cause
2-to-3 translation problems for people using this in 2.x.  (I don't
immediately see why it would.)

Might there be political reasons not to backport this to 2.x?  I seem to
recall it being suggested at the PyCon language summit that we
should consider making new features 3.x only, but I don't entirely
remember what the rationale for this was.

[Alexandre Vassalotti]
> On Sat, Aug 15, 2009 at 2:42 PM, Mark Dickinson<dickinsm at gmail.com> wrote:
>> If these additions to int go in, then presumably the _PyLong_AsBytes
>> and _PyLong_FromBytes functions should be documented and made public
>> (and have their leading underscores removed, too).
>
> You are referring to _PyLong_FromByteArray and _PyLong_AsByteArray, right?

Whoops!  Yes, that's what I meant.  Thanks.  :)

Sorry for my silence on the issue tracker.  I'll try to find time to look at
your new patch this weekend.

Mark



More information about the Python-ideas mailing list