Re: [Python-Dev] 2.5 issues need resolving in a few days

2006-06-11 Thread Nick Coghlan
Fred L. Drake, Jr. wrote: On Saturday 10 June 2006 12:34, Fredrik Lundh wrote: if all undocumented modules had as much documentation and articles as ET, the world would be a lot better documented ;-) I've posted a text version of the xml.etree.ElementTree PythonDoc here: Here's a

Re: [Python-Dev] Segmentation fault in collections.defaultdict

2006-06-11 Thread Nick Coghlan
Kevin Jacobs [EMAIL PROTECTED] wrote: Try this at home: import collections d=collections.defaultdict(int) d.iterkeys().next() # Seg fault d.iteritems().next() # Seg fault d.itervalues().next() # Fine and dandy This all worked fine for me in rev 46739 and 46849 (Kubuntu 6.06, gcc 4.0.3).

Re: [Python-Dev] Segmentation fault in collections.defaultdict

2006-06-11 Thread Georg Brandl
Nick Coghlan wrote: Kevin Jacobs [EMAIL PROTECTED] wrote: Try this at home: import collections d=collections.defaultdict(int) d.iterkeys().next() # Seg fault d.iteritems().next() # Seg fault d.itervalues().next() # Fine and dandy This all worked fine for me in rev 46739 and 46849

[Python-Dev] crash in dict on gc collect

2006-06-11 Thread Neal Norwitz
I wonder if this is similar to Kevin's problem? I couldn't reproduce his problem though. This happens with both debug and release builds. Not sure how to reduce the test case. pychecker was just iterating through the byte codes. It wasn't doing anything particularly interesting. ./python

Re: [Python-Dev] 2.5 issues need resolving in a few days

2006-06-11 Thread Fredrik Lundh
Fred L. Drake, Jr. wrote: With the introduction of the xmlcore package in Python 2.5, should we document xml.etree or xmlcore.etree? If someone installs PyXML with Python 2.5, I don't think they're going to get xml.etree, which will be really confusing. We can be sure that

Re: [Python-Dev] 2.5 issues need resolving in a few days

2006-06-11 Thread Simon Percivall
On 11 jun 2006, at 12.09, Fredrik Lundh wrote: Fred L. Drake, Jr. wrote: With the introduction of the xmlcore package in Python 2.5, should we document xml.etree or xmlcore.etree? If someone installs PyXML with Python 2.5, I don't think they're going to get xml.etree, which will be

Re: [Python-Dev] UUID module

2006-06-11 Thread Giovanni Bajo
Ka-Ping Yee [EMAIL PROTECTED] wrote: Quite a few people have expressed interest in having UUID functionality in the standard library, and previously on this list some suggested possibly using the uuid.py module i wrote: http://zesty.ca/python/uuid.py Some comments on the code: for

Re: [Python-Dev] 2.5 issues need resolving in a few days

2006-06-11 Thread Fredrik Lundh
Simon Percivall wrote: how about tweaking the xml loader to map xml.foo to _xmlplus.foo only if that subpackage really exists ? I'm a bit confused by what the problem is. I though this was all handled like it should be now. that's how I thought things were done, but then I read Fred's

[Python-Dev] sgmllib Comments

2006-06-11 Thread Sam Ruby
Planet is a feed aggregator written in Python. It depends heavily on SGMLLib. A recent bug report turned out to be a deficiency in sgmllib, and I've submitted a test case and a patch[1] (use or discard the patch, it is the test that I care about). While looking around, a few things surfaced.

Re: [Python-Dev] Switch statement

2006-06-11 Thread Talin
Greg Ewing wrote: [EMAIL PROTECTED] wrote: switch raw_input(enter a, b or c: ): case 'a': print 'yay! an a!' case 'b': print 'yay! a b!' case 'c': print 'yay! a c!' else: print 'hey dummy! I said a, b or c!'

Re: [Python-Dev] sgmllib Comments

2006-06-11 Thread Aahz
On Sun, Jun 11, 2006, Sam Ruby wrote: Planet is a feed aggregator written in Python. It depends heavily on SGMLLib. A recent bug report turned out to be a deficiency in sgmllib, and I've submitted a test case and a patch[1] (use or discard the patch, it is the test that I care about).

[Python-Dev] Import semantics

2006-06-11 Thread Fabio Zadrozny
Python and Jython import semantics differ on how sub-packages should be accessed after importing some module:Jython 2.1 on java1.5.0 (JIT: null)Type copyright, credits or license for more information. import xml xml.dommodule xml.dom at 10340434Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC

Re: [Python-Dev] Switch statement

2006-06-11 Thread skip
talin Since you don't have the 'fall-through' behavior of C, I would talin also assume that you could associate more than one value with a talin case, i.e.: talin case 'a', 'b', 'c': talin... As Andrew Koenig pointed out, that's not discussed in the PEP. Given

Re: [Python-Dev] Switch statement

2006-06-11 Thread Fredrik Lundh
Talin wrote: I don't have any specific syntax proposals, but I notice that the suite that follows the switch statement is not a normal suite, but a restricted one, and I am wondering if we could come up with a syntax that avoids having a special suite. don't have KR handy, but I'm pretty

Re: [Python-Dev] Switch statement

2006-06-11 Thread Talin
[EMAIL PROTECTED] wrote: talin Since you don't have the 'fall-through' behavior of C, I would talin also assume that you could associate more than one value with a talin case, i.e.: talin case 'a', 'b', 'c': talin... As Andrew Koenig pointed out, that's

[Python-Dev] subprocess.Popen(.... stdout=IGNORE, ...)

2006-06-11 Thread Martin Blais
In the subprocess module, by default the files handles in the child are inherited from the parent. To ignore a child's output, I can use the stdout or stderr options to send the output to a pipe:: p = Popen(command, stdout=PIPE, stderr=PIPE) However, this is sensitive to the buffer deadlock

Re: [Python-Dev] UUID module

2006-06-11 Thread Ka-Ping Yee
Thomas Heller wrote: I don't know if this is the uuidgen you're talking about, but on linux there is libuuid: Thanks! Okay, that's in there now. Have a look at http://zesty.ca/python/uuid.py . Phillip J. Eby wrote: By the way, I'd love to see a uuid.uuid() constructor that simply calls the

[Python-Dev] Should hex() yield 'L' suffix for long numbers?

2006-06-11 Thread Ka-Ping Yee
I did this earlier: hex(9) '0x9184e729fffL' and found it a little jarring, because i feel there's been a general trend toward getting rid of the 'L' suffix in Python. Literal long integers don't need an L anymore; they're automatically made into longs if the number is too

Re: [Python-Dev] a note in random.shuffle.__doc__ ...

2006-06-11 Thread Greg Ewing
Terry Jones wrote: Suppose you have a RNG with a cycle length of 5. There's nothing to stop an algorithm from taking multiple already returned values and combining them in some (deterministic) way to generate 5 outcomes. No, it's not. As long as the RNG output is the only input to the

Re: [Python-Dev] Pre-PEP: Allow Empty Subscript List Without Parentheses

2006-06-11 Thread Greg Ewing
BJörn Lindqvist wrote: I don't know how difficult it is to get rid of the implicit return None or even if it is doable, but if it is, it should, IMHO, be done. It's been proposed before, and the conclusion was that it would cause more problems than it would solve. (Essentially it would

Re: [Python-Dev] Switch statement

2006-06-11 Thread Greg Ewing
Talin wrote: Since you don't have the 'fall-through' behavior of C, I would also assume that you could associate more than one value with a case, i.e.: case 'a', 'b', 'c': ... Multiple values could be written case 'a': case 'b': case 'c': ... without conflicting

Re: [Python-Dev] Switch statement

2006-06-11 Thread Greg Ewing
[EMAIL PROTECTED] wrote: I agree, but that of course limits the expressions to constants which can be evaluated at compile-time as I indicated in my previous mail. A way out of this would be to define the semantics so that the expression values are allowed to be cached, and the order of

Re: [Python-Dev] a note in random.shuffle.__doc__ ...

2006-06-11 Thread Terry Jones
Greg == Greg Ewing [EMAIL PROTECTED] writes: Greg Terry Jones wrote: Suppose you have a RNG with a cycle length of 5. There's nothing to stop an algorithm from taking multiple already returned values and combining them in some (deterministic) way to generate 5 outcomes. Greg No, it's not.

Re: [Python-Dev] sgmllib Comments

2006-06-11 Thread Terry Reedy
Fred L. Drake, Jr. [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sunday 11 June 2006 16:26, Sam Ruby wrote: Planet is a feed aggregator written in Python. It depends heavily on SGMLLib. A recent bug report turned out to be a deficiency in sgmllib, and I've submitted a

Re: [Python-Dev] Import semantics

2006-06-11 Thread Terry Reedy
Fabio Zadrozny [EMAIL PROTECTED] wrote in message Jython 2.1 on java1.5.0 (JIT: null) Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Jython 2.1 intends to match Python 2.1, I believe. Python 2.2, which I still have loaded, matches Python 2.4 in the behavior

Re: [Python-Dev] subprocess.Popen(.... stdout=IGNORE, ...)

2006-06-11 Thread Terry Reedy
Martin Blais [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Any idea how this idiom could be supported using a more portable solution (i.e. how would I make this idiom under Windows, is there some equivalent to /dev/null)? On a DOS/Windows command line, 'NUL:' or 'nul:'

Re: [Python-Dev] Should hex() yield 'L' suffix for long numbers?

2006-06-11 Thread Tim Peters
[Ka-Ping Yee] I did this earlier: hex(9) '0x9184e729fffL' and found it a little jarring, because i feel there's been a general trend toward getting rid of the 'L' suffix in Python. Literal long integers don't need an L anymore; they're automatically made into longs

Re: [Python-Dev] a note in random.shuffle.__doc__ ...

2006-06-11 Thread Tim Peters
[Terry Jones] The code below uses a RNG with period 5, is deterministic, and has one initial state. It produces 20 different outcomes. Well, I'd call the sequence of 20 numbers it produces one outcome. From that view, there are at most 5 outcomes it can produce (at most 5 distinct 20-number

Re: [Python-Dev] sgmllib Comments

2006-06-11 Thread Sam Ruby
Fred L. Drake, Jr. wrote: On Sunday 11 June 2006 16:26, Sam Ruby wrote: Planet is a feed aggregator written in Python. It depends heavily on SGMLLib. A recent bug report turned out to be a deficiency in sgmllib, and I've submitted a test case and a patch[1] (use or discard the patch,

Re: [Python-Dev] sgmllib Comments

2006-06-11 Thread Sam Ruby
Terry Reedy wrote: Fred L. Drake, Jr. [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sunday 11 June 2006 16:26, Sam Ruby wrote: Planet is a feed aggregator written in Python. It depends heavily on SGMLLib. A recent bug report turned out to be a deficiency in sgmllib, and

Re: [Python-Dev] sgmllib Comments

2006-06-11 Thread Fred L. Drake, Jr.
On Monday 12 June 2006 00:05, Sam Ruby wrote: Just to be clear: Planet uses Mark's feed parser, which uses SGMLlib. Cool. I was investigating a bug in sgmllib which affected the feed parser (and therefore Planet), and noticed that there were changes in the SVN head of Python which broke

Re: [Python-Dev] sgmllib Comments

2006-06-11 Thread Martin v. Löwis
Sam Ruby wrote: Planet is a feed aggregator written in Python. It depends heavily on SGMLLib. A recent bug report turned out to be a deficiency in sgmllib, and I've submitted a test case and a patch[1] (use or discard the patch, it is the test that I care about). I think (but am not

Re: [Python-Dev] 2.5 issues need resolving in a few days

2006-06-11 Thread Martin v. Löwis
Neal Norwitz wrote: The most important outstanding issue is the xmlplus/xmlcore issue. It's not going to get fixed unless someone works on it. There's only a few days left before beta 1. Can someone please address this? From my point of view, I shall consider them resolved/irrelevant: I'm

Re: [Python-Dev] sgmllib Comments

2006-06-11 Thread Sam Ruby
Martin v. Löwis wrote: Alternatively, a callback function could be provided for character references. Unfortunately, the existing callback is unsuitable, as it is supposed to do the full processing; this callback should return the replacement text. Generally assuming Unicode would be wrong,