Re: [Python-Dev] sgmllib Comments

2006-06-11 Thread Martin v. Löwis
Sam Ruby wrote: > If we can agree on the behavior, I would be glad to write up a patch. > > It seems to me that the simplest way to proceed would be for the code > that attempts to resolve character references (both named and numeric) > in attributes to be isolated in a single method. Subclasses

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 > w

Re: [Python-Dev] sgmllib Comments

2006-06-11 Thread Sam Ruby
Fred L. Drake, Jr. wrote: > 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 change

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 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 s

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 bro

Re: [Python-Dev] sgmllib Comments

2006-06-11 Thread Martin v. Löwis
Aahz wrote: > When providing links to SF, please use the python.org tinyurl equivalent > to ensure that people can easily see the bug/patch number: > > http://www.python.org/sf?id=1504333 Although I usually use the path-style form: http://www.python.org/sf/1504333 Regards, Martin __

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 sgml

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 pa

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 s

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

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 '>nu

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] 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 submi

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

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 evalu

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 conflic

Re: [Python-Dev] sgmllib Comments

2006-06-11 Thread Fred L. Drake, Jr.
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, > it is the test that I care

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 r

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 alg

[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] 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 th

[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 p

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 ou

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 K&R handy, but I'm pre

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. Giv

[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.domPython 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel

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)

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

[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] 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 F

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: >

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

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 xmlcore.

Re: [Python-Dev] Add pure python PNG writer module to stdlib?

2006-06-11 Thread Bob Ippolito
On Jun 10, 2006, at 10:52 PM, Johann C. Rocholl wrote: >>> Does anybody think it could go into stdlib before the feature >>> freeze for >> 2.5? >> >> Nope. To get added to the stdlib there needs to be support from the >> community that the module is useful and best-of-breed. Try >> posting o

[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 pyche