On 3/17/06, Josiah Carlson <[EMAIL PROTECTED]> wrote:
> Considering your quote, I have thusfar not seen any opinion dissenting
> from what I stated as 'obvious' behavior.
FWIW, I have no objections to the behaviour you state as "obvious",
but I didn't find it immediately obvious (although admitted
"Christos Georgiou" <[EMAIL PROTECTED]> wrote:
> [Christos]
> > These details should be considered in the PEP.
>
> [Josiah]
> > They aren't considered because they are *obvious* to most (if not all)
> > sane people who use Python.
>
> I beg to disagree. I don't know whether you are Dutch or not
"Josiah Carlson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
"Christos Georgiou" <[EMAIL PROTECTED]> wrote:
[Christos]
> Well, what's the result of
>
> bytes([1,0,0])^ bytes([1,0])
>
> ? Is it bytes([0,0,0]) (à la little-endian) or is it bytes([1,1,0])
> (straight conversion to
On 3/16/06, Greg Ewing <[EMAIL PROTECTED]> wrote:
> BTW, is anyone else bothered that the term "bytes object"
> is a bit cumbersome? Also confusing as to whether it's
> singular or plural. Could we perhaps call it a bytevector
> or bytearray or something?
Doesn't really bother me. You could call i
Baptiste Carvello wrote:
> They are not *that* obvious. Logical operations on ints have allowed users to
> forget about size (and shoot themselves in the foot from time to time). Or is
> 1^(~1) == -1 obvious ? Well, maybe that's not sane either :-)
It's about as sane as you can get in a world wh
Baptiste Carvello <[EMAIL PROTECTED]> wrote:
> Josiah Carlson a écrit :
>
> > They aren't considered because they are *obvious* to most (if not all)
> > sane people who use Python.
>
> They are not *that* obvious. Logical operations on ints have allowed users to
> forget about size (and shoot
Christos Georgiou wrote:
> Well, what's the result of
>
> bytes([1,0,0])^ bytes([1,0])
>
> ? Is it bytes([0,0,0]) (à la little-endian) or is it bytes([1,1,0])
> (straight conversion to base-256)? Or perhaps throw a ValueError if the
> sizes differ?
In the interests of refusing the temptation
Josiah Carlson a écrit :
> They aren't considered because they are *obvious* to most (if not all)
> sane people who use Python.
They are not *that* obvious. Logical operations on ints have allowed users to
forget about size (and shoot themselves in the foot from time to time). Or is
1^(~1) ==
"Christos Georgiou" <[EMAIL PROTECTED]> wrote:
> Well, what's the result of
>
> bytes([1,0,0])^ bytes([1,0])
>
> ? Is it bytes([0,0,0]) (à la little-endian) or is it bytes([1,1,0])
> (straight conversion to base-256)? Or perhaps throw a ValueError if the
> sizes differ?
It's a ValueError. I
"Greg Ewing" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Baptiste Carvello wrote:
>
[Baptiste]
>> while manipulating binary data will happen mostly with bytes objects,
>> some
>> operations are better done with ints, like the bit manipulations with the
>> &|~^
>> operators.
[Gre
Greg Ewing a écrit :
> Why not just support bitwise operations directly
> on the bytes object?
>
Sure, what counts is that all the nice features that Python has for editing
binary data are usable with the bytes object.
These include bitwise operations, hex() and oct() representation functions an
Greg Ewing wrote:
> Baptiste Carvello wrote:
>
>> while manipulating binary data will happen mostly with bytes objects, some
>> operations are better done with ints, like the bit manipulations with the
>> &|~^
>> operators.
>
> Why not just support bitwise operations directly
> on the bytes ob
Baptiste Carvello wrote:
> while manipulating binary data will happen mostly with bytes objects, some
> operations are better done with ints, like the bit manipulations with the
> &|~^
> operators.
Why not just support bitwise operations directly
on the bytes object?
--
Greg Ewing, Computer
some more thoughts about the bytes object:
1) it would be nice to have an trivial way to change a bytes object to an int /
long, and vice versa.
Rationale:
while manipulating binary data will happen mostly with bytes objects, some
operations are better done with ints, like the bit manipulation
1. Maybe there should be a more obvious way to spell "bytes([0])*N".
I went through "bytes([0]*N)" and "bytes('\0'*N)" before I realized
there was a memory-efficient way to do it.
1a. Likewise, slice-assignment nicely handles memmove(), but there's
no memset().
2. Having a plural noun as a typ
15 matches
Mail list logo