[Python-Dev] New style classes and operator methods

2005-04-07 Thread Greg Ewing
I think I've found a small flaw in the implementation of binary operator methods for new-style Python classes. If the left and right operands are of the same class, and the class implements a right operand method but not a left operand method, the right operand method is not called. Instead, two at

Re: [Python-Dev] Developer list update

2005-04-07 Thread Alex Martelli
On Apr 7, 2005, at 07:58, Raymond Hettinger wrote: Does anyone know what has become of the following developers and perhaps have their current email addresses? Are any of these folks still active in Python development? Ben Gertzfield Charles G Waldman Eric Price Finn Bock Ken Manheime

RE: [Python-Dev] Developer list update

2005-04-07 Thread Raymond Hettinger
Does anyone know what has become of the following developers and perhaps have their current email addresses? Are any of these folks still active in Python development? Ben Gertzfield Charles G Waldman Eric Price Finn Bock Ken Manheimer Moshe Zadka Raymond Hettinger _

Re: [Python-Dev] Unicode byte order mark decoding

2005-04-07 Thread Stephen J. Turnbull
> "MvL" == "Martin v. Löwis" <[EMAIL PROTECTED]> writes: MvL> This would also support your usecase, and in a better way. MvL> The Unicode assertion that UTF-16 is BE by default is void MvL> these days - there is *always* a higher layer protocol, and MvL> it more often than not

Re: [Python-Dev] Unicode byte order mark decoding

2005-04-07 Thread M.-A. Lemburg
Martin v. Löwis wrote: > Nicholas Bastin wrote: > >>It would be nice if you could optionally specify that the codec would >>assume UTF-16BE if no BOM was present, and not raise UnicodeError in >>that case, which would preserve the current behaviour as well as allow >>users' to ask for behaviour wh

Re: [Python-Dev] Unicode byte order mark decoding

2005-04-07 Thread Walter Dörwald
Walter Dörwald sagte: > Nicholas Bastin sagte: > > It should be feasible to implement your own codec for that > based on Lib/encodings/utf_16.py. Simply replace the line > in StreamReader.decode(): > raise UnicodeError,"UTF-16 stream does not start with BOM" > with: > self.decode = codecs.utf_

Re: [Python-Dev] Unicode byte order mark decoding

2005-04-07 Thread Martin v. Löwis
Nicholas Bastin wrote: > It would be nice if you could optionally specify that the codec would > assume UTF-16BE if no BOM was present, and not raise UnicodeError in > that case, which would preserve the current behaviour as well as allow > users' to ask for behaviour which conforms to the standard

Re: [Python-Dev] Unicode byte order mark decoding

2005-04-07 Thread Walter Dörwald
Nicholas Bastin sagte: > On Apr 7, 2005, at 11:35 AM, M.-A. Lemburg wrote: > > [...] >> If you do have UTF-16 without a BOM mark it's much better >> to let a short function analyze the text by reading for first >> few bytes of the file and then make an educated guess based >> on the findings. You

Re: [Python-Dev] Unicode byte order mark decoding

2005-04-07 Thread Nicholas Bastin
On Apr 7, 2005, at 11:35 AM, M.-A. Lemburg wrote: Ok, but I don't really follow you here: you are suggesting to relax the current UTF-16 behavior and to start defaulting to UTF-16-BE if no BOM is present - that's most likely going to cause more problems that it seems to solve: namely complete garba

Re: [Python-Dev] threading (GilState) question

2005-04-07 Thread Michael Hudson
Tim Peters <[EMAIL PROTECTED]> writes: > [Michael Hudson] >> ... >> Point the first is that I really think this is a bug in the GilState >> APIs: the readline API isn't inherently multi-threaded and so it would >> be insane to call PyEval_InitThreads() in initreadline, yet it has to >> cope with b

Re: [Python-Dev] Unicode byte order mark decoding

2005-04-07 Thread M.-A. Lemburg
Nicholas Bastin wrote: > > On Apr 7, 2005, at 5:07 AM, M.-A. Lemburg wrote: > >>> The current implementation of the utf-16 codecs makes for some >>> irritating gymnastics to write the BOM into the file before reading it >>> if it contains no BOM, which seems quite like a bug in the codec. >> >> >

Re: [Python-Dev] threading (GilState) question

2005-04-07 Thread Tim Peters
[Michael Hudson] > ... > Point the first is that I really think this is a bug in the GilState > APIs: the readline API isn't inherently multi-threaded and so it would > be insane to call PyEval_InitThreads() in initreadline, yet it has to > cope with being called in a multithreaded situation. If y

Re: [Python-Dev] Unicode byte order mark decoding

2005-04-07 Thread Nicholas Bastin
On Apr 7, 2005, at 5:07 AM, M.-A. Lemburg wrote: The current implementation of the utf-16 codecs makes for some irritating gymnastics to write the BOM into the file before reading it if it contains no BOM, which seems quite like a bug in the codec. The codec writes a BOM in the first call to .write

Re: [Python-Dev] threading (GilState) question

2005-04-07 Thread Michael Hudson
Nick Coghlan <[EMAIL PROTECTED]> writes: > Michael Hudson wrote: >> Option 1) Call PyEval_ThreadsInitialized() in PyGilState_Release(). >> Non-invasive, but bleh. > > Tim rejected this option back when PyEval_ThreadsInitialized() was > added to the API [1]. Well, not really. The patch that was r

Re: [Python-Dev] threading (GilState) question

2005-04-07 Thread Nick Coghlan
Michael Hudson wrote: Option 1) Call PyEval_ThreadsInitialized() in PyGilState_Release(). Non-invasive, but bleh. Tim rejected this option back when PyEval_ThreadsInitialized() was added to the API [1]. Gustavo was having a similar problem with pygtk, and the end result was to add the ThreadsInit

[Python-Dev] threading (GilState) question

2005-04-07 Thread Michael Hudson
I recently redid how the readline module handled threads around callbacks into Python (the previous code was insane). This resulted in the following bug report: http://www.python.org/sf/1176893 Which is correctly assigned to me as it's clearly a result of my recent checkin. However, I think

Re: [Python-Dev] Unicode byte order mark decoding

2005-04-07 Thread M.-A. Lemburg
Nicholas Bastin wrote: > > On Apr 5, 2005, at 6:19 AM, M.-A. Lemburg wrote: > >> Note that the UTF-16 codec is strict w/r to the presence >> of the BOM mark: you get a UnicodeError if a stream does >> not start with a BOM mark. For the UTF-8-SIG codec, this >> should probably be relaxed to not re

Re: [Python-Dev] Re: hierarchicial named groups extension to the re library

2005-04-07 Thread Anthony Baxter
On Sunday 03 April 2005 16:48, Martin v. Löwis wrote: > If this kind of functionality would fall on immediate rejection for > some reason, even writing the PEP might be pointless. Note that even if something is rejected, the PEP itself is useful - it collects knowledge in a format that's far more