Re: [Python-Dev] PEP 385: the eol-type issue

2009-08-06 Thread Martin v. Löwis
This is simply false AFAICS. There was little participation on this particular issue during PEP 374 that I can recall. Now that it is clearly an issue after all, it's still early in the PEP 385 process. Martin has already picked up the ball on EOL support, and has carried informal design

Re: [Python-Dev] PEP 385: the eol-type issue

2009-08-06 Thread Stephen J. Turnbull
Martin v. Löwis writes: This is simply false AFAICS. There was little participation on this particular issue during PEP 374 that I can recall. Now that it is clearly an issue after all, it's still early in the PEP 385 process. Martin has already picked up the ball on EOL support, and

Re: [Python-Dev] PEP 385: the eol-type issue

2009-08-06 Thread M.-A. Lemburg
Neil Hodgson wrote: Glenn Linderman: and perhaps other things (and are there new Unicode control characters that could be used for line endings?), Unicode includes Line Separator U+2028 and Paragraph Separator U+2029 but they are rarely supported and very rarely used. They are a pain

Re: [Python-Dev] PEP 385: the eol-type issue

2009-08-06 Thread Antoine Pitrou
M.-A. Lemburg mal at egenix.com writes: Please file a bug report for this. f.readlines() (or rather the io layer) should be using Py_UNICODE_ISLINEBREAK(ch) for detecting line break characters. Actually, no. It has been designed from the start to only recognize the standard line break

Re: [Python-Dev] PEP 385: the eol-type issue

2009-08-06 Thread Nick Coghlan
Antoine Pitrou wrote: M.-A. Lemburg mal at egenix.com writes: Please file a bug report for this. f.readlines() (or rather the io layer) should be using Py_UNICODE_ISLINEBREAK(ch) for detecting line break characters. Actually, no. It has been designed from the start to only recognize the

Re: [Python-Dev] PEP 385: the eol-type issue

2009-08-06 Thread M.-A. Lemburg
Nick Coghlan wrote: Antoine Pitrou wrote: M.-A. Lemburg mal at egenix.com writes: Please file a bug report for this. f.readlines() (or rather the io layer) should be using Py_UNICODE_ISLINEBREAK(ch) for detecting line break characters. Actually, no. It has been designed from the start to

Re: [Python-Dev] PEP 385: the eol-type issue

2009-08-06 Thread M.-A. Lemburg
M.-A. Lemburg wrote: Nick Coghlan wrote: Antoine Pitrou wrote: M.-A. Lemburg mal at egenix.com writes: Please file a bug report for this. f.readlines() (or rather the io layer) should be using Py_UNICODE_ISLINEBREAK(ch) for detecting line break characters. Actually, no. It has been

Re: [Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-06 Thread Nick Coghlan
P.J. Eby wrote: At 05:59 PM 8/5/2009 -0700, Raymond Hettinger wrote: [Jeffrey E. McAninch, PhD] I very often want something like a try-except conditional expression similar to the if-else conditional. An example of the proposed syntax might be: x = float(string) except float('nan') or

Re: [Python-Dev] PEP 385: the eol-type issue

2009-08-06 Thread Antoine Pitrou
M.-A. Lemburg mal at egenix.com writes: What I don't understand is why the io layer tries to reinvent the wheel here instead of just using the codec's .readline() method - which *does* use .splitlines() and has full support for all Unicode line break characters (including the CRLF

Re: [Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-06 Thread Dj Gilcrease
On Thu, Aug 6, 2009 at 4:47 AM, Nick Coghlanncogh...@gmail.com wrote: Option 2:  x = float(string) except ValueError: float('nan')  op(float(string) except ValueError: float('nan')) This has the virtue of closely matching the statement syntax, but embedding colons inside expressions is

Re: [Python-Dev] (try-except) conditional expression si milar to (if-else) conditional (PEP 308)

2009-08-06 Thread Antoine Pitrou
Raymond Hettinger python at rcn.com writes: For example: x = min(seq) except ValueError else 0 # default to zero for empty sequences How about: x = min(seq) if seq else 0 Shorter and more readable (except X else Y isn't very logical). sample_std_deviation = sqrt(sum(x - mu

Re: [Python-Dev] PEP 385: the eol-type issue

2009-08-06 Thread M.-A. Lemburg
Antoine Pitrou wrote: M.-A. Lemburg mal at egenix.com writes: What I don't understand is why the io layer tries to reinvent the wheel here instead of just using the codec's .readline() method - which *does* use .splitlines() and has full support for all Unicode line break characters

Re: [Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-06 Thread Xavier Morel
On 6 Aug 2009, at 00:22 , Jeff McAninch wrote: I'm new to this list, so please excuse me if this topic has been discussed, but I didn't see anything similar in the archives. I very often want something like a try-except conditional expression similar to the if-else conditional. I fear this

Re: [Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-06 Thread MRAB
Nick Coghlan wrote: P.J. Eby wrote: At 05:59 PM 8/5/2009 -0700, Raymond Hettinger wrote: [Jeffrey E. McAninch, PhD] I very often want something like a try-except conditional expression similar to the if-else conditional. An example of the proposed syntax might be: x = float(string) except

Re: [Python-Dev] PEP 385: the eol-type issue

2009-08-06 Thread Antoine Pitrou
M.-A. Lemburg mal at egenix.com writes: Sure, but the code for line splitting is not really all that complicated (see PyUnicode_Splitlines()), so could easily be adapted to work on buffers directly. Certainly indeed. It all comes down to compatibility with the original implementation. (PEP

Re: [Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-06 Thread Eric Pruitt
What about catching specific error numbers? Maybe an option so that the dictionary elements can also be dictionaries with integers as the keys: filedata = try_3(open, randomfile, except = { IOError, {2: None} } ) If it isn't found in the dictionary, then we raise the error. On Thu, Aug 6,

[Python-Dev] Tkinter has many files

2009-08-06 Thread cool-RR
Hello python-dev! I'm a Python programmer, but this is the first time I'm posting on python-dev, and I am not familiar at all with how the Python implementation works -- so this post may be way off. I've recently released a Python application, PythonTurtlehttp://pythonturtle.com, which is

Re: [Python-Dev] Tkinter has many files

2009-08-06 Thread Michael Foord
cool-RR wrote: Hello python-dev! I'm a Python programmer, but this is the first time I'm posting on python-dev, and I am not familiar at all with how the Python implementation works -- so this post may be way off. I've recently released a Python application, PythonTurtle

Re: [Python-Dev] Tkinter has many files

2009-08-06 Thread cool-RR
Why do you need to keep the whole Python distribution under version control? Isn't all you need a script to *generate* the py2exe'd output from an *installed* Python? This is the approach I take with Movable Python which does something very similar. Never mind the source control issue, it's

Re: [Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-06 Thread Russell E. Owen
In article d28975e8-6706-4515-9c9e-fb7f90775...@masklinn.net, Xavier Morel catch-...@masklinn.net wrote: On 6 Aug 2009, at 00:22 , Jeff McAninch wrote: I'm new to this list, so please excuse me if this topic has been discussed, but I didn't see anything similar in the archives. I

Re: [Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-06 Thread Dino Viehland
On option 1 is this legal then? x = float(string) except float('nan') if some_check() else float('inf') if ValueError -Original Message- From: python-dev-bounces+dinov=microsoft@python.org [mailto:python-dev-bounces+dinov=microsoft@python.org] On Behalf Of Nick Coghlan Sent:

[Python-Dev] issue 6654

2009-08-06 Thread Kristján Valur Jónsson
I added http://bugs.python.org/issue6654 I also put a not to python-ideas but have had no response yet. Any comments? Here's the summary: I've created http://codereview.appspot.com/100046 on Rietveld: by passing the path component of the xmlrpc request to the dispatch method, itbecomes

Re: [Python-Dev] PEP 385: the eol-type issue

2009-08-06 Thread Neil Hodgson
M.-A. Lemburg: ... and because of this, the feature is already available if you use codecs.open() instead of the built-in open(): So should I not add an issue for the basic open because codecs.open should be used for this case? Neil ___

Re: [Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-06 Thread Dino Viehland
MRAB wrote: Dino Viehland wrote: On option 1 is this legal then? x = float(string) except float('nan') if some_check() else float('inf') if ValueError Well, is this is legal? try: x = float(string) except some_check(): x = float('nan') except

Re: [Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-06 Thread MRAB
Dino Viehland wrote: MRAB wrote: Dino Viehland wrote: On option 1 is this legal then? x = float(string) except float('nan') if some_check() else float('inf') if ValueError Well, is this is legal? try: x = float(string) except some_check(): x = float('nan')