Jason Orendorff wrote:
> I like these promises:
> - bytes(arg) works like array.array('b', arg)
> - bytes(arg1, arg2) works like bytes(arg1.encode(arg2))
+1. That's exactly how I think it should work, too.
> I dislike these promises:
> - bytes(s, [ignored]), where s is a str, works like ar
Neil Schemenauer wrote:
> Ron Adam <[EMAIL PROTECTED]> wrote:
>> Why was it decided that the unicode encoding argument should be ignored
>> if the first argument is a string? Wouldn't an exception be better
>> rather than give the impression it does something when it doesn't?
>
>From the PEP:
>
>
Neil Schemenauer wrote:
> Ron Adam <[EMAIL PROTECTED]> wrote:
>> Why was it decided that the unicode encoding argument should be ignored
>> if the first argument is a string? Wouldn't an exception be better
>> rather than give the impression it does something when it doesn't?
>
>>From the PEP:
Ron Adam <[EMAIL PROTECTED]> wrote:
> Why was it decided that the unicode encoding argument should be ignored
> if the first argument is a string? Wouldn't an exception be better
> rather than give the impression it does something when it doesn't?
>From the PEP:
There is no sane meaning th
Neil Schemenauer wrote:
> Michael Hoffman <[EMAIL PROTECTED]> wrote:
>> Am I the only one who finds the use of "self" on a classmethod to be
>> incredibly confusing? Can we please follow PEP 8 and use "cls"
>> instead?
>
> Sorry, using "self" was an oversight. It should be "cls", IMO.
>
> Neil
Michael Hoffman <[EMAIL PROTECTED]> wrote:
> Am I the only one who finds the use of "self" on a classmethod to be
> incredibly confusing? Can we please follow PEP 8 and use "cls"
> instead?
Sorry, using "self" was an oversight. It should be "cls", IMO.
Neil
___
[Neil Schemenauer]
>> @classmethod
>> def fromhex(self, data):
>> data = re.sub(r'\s+', '', data)
>> return bytes(binascii.unhexlify(data))
[Jason Orendorff]
> If it's to be a classmethod, I guess that should be "return self(
> binascii.unhexlify(data))".
Am I the only one
On 2/22/06, Neil Schemenauer <[EMAIL PROTECTED]> wrote:
@classmethoddef fromhex(self, data):data = "" '', data)return bytes(binascii.unhexlify(data))If it's to be a classmethod, I guess that should be "return self(
binascii.unhexlify(data))".-j
__
On Thu, Feb 16, 2006 at 12:47:22PM -0800, Guido van Rossum wrote:
> BTW, for folks who want to experiment, it's quite simple to create a
> working bytes implementation by inheriting from array.array. Here's a
> quick draft (which only takes str instance arguments):
Here's a more complete prototype
Guido van Rossum wrote:
> On 2/15/06, Neil Schemenauer <[EMAIL PROTECTED]> wrote:
>> This could be a replacement for PEP 332. At least I hope it can
>> serve to summarize the previous discussion and help focus on the
>> currently undecided issues.
>>
>> I'm too tired to dig up the rules for assign
On 2/15/06, Neil Schemenauer <[EMAIL PROTECTED]> wrote:
> This could be a replacement for PEP 332. At least I hope it can
> serve to summarize the previous discussion and help focus on the
> currently undecided issues.
>
> I'm too tired to dig up the rules for assigning it a PEP number.
> Also, th
On Thu, 16 Feb 2006 12:47:22 -0800, Guido van Rossum <[EMAIL PROTECTED]> wrote:
>On 2/15/06, Neil Schemenauer <[EMAIL PROTECTED]> wrote:
>> This could be a replacement for PEP 332. At least I hope it can
>> serve to summarize the previous discussion and help focus on the
>> currently undecided is
This could be a replacement for PEP 332. At least I hope it can
serve to summarize the previous discussion and help focus on the
currently undecided issues.
I'm too tired to dig up the rules for assigning it a PEP number.
Also, there are probably silly typos, etc. Sorry.
Neil
PEP: XXX
Title:
13 matches
Mail list logo