Re: [Python-Dev] Implementing File Modes

2009-07-27 Thread MRAB
Steven D'Aprano wrote: On Tue, 28 Jul 2009 03:21:30 am MRAB wrote: What about stderr? You could add "e" if you want to read from it. "Read from stderr" is just a read. "Write to stderr" is just a write. The difference between reading stdout and stderr is

Re: [Python-Dev] [regex] memory leak

2009-08-02 Thread MRAB
John Machin wrote: Hi Matthew, Your post in c.l.py about your re rewrite didn't mention where to report bugs etc so I dug this address out of Google Groups ... Environment: Python 2.6.2, Windows XP SP3, your latest (29 July) regex from the Python bugtracker. Problem is repeated calls of e.

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

2009-08-05 Thread MRAB
Nick Coghlan wrote: Mark Hammond wrote: On 5/08/2009 7:09 PM, Dirkjan Ochtman wrote: I'm not sure how win32text will provide anything other than performance degradation for non-Windows developers, but if there's functionality to be had, I'm happy to mandate its use on every platform. I see two

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] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-06 Thread MRAB
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 ValueError: x = float('in

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

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

2009-08-06 Thread MRAB
Russell E. Owen wrote: In article , Xavier Morel 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 very often want something like a try-except conditional e

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

2009-08-07 Thread MRAB
Jeff McAninch wrote: Should be legal, right?, since syntax would be except if Dino Viehland wrote: On option 1 is this legal then? x = float(string) except float('nan') if some_check() else float('inf') if ValueError Thinking more about the syntax options: if P.J.'s "if" Option is u

Re: [Python-Dev] Decorator syntax

2009-09-02 Thread MRAB
James Y Knight wrote: On Sep 2, 2009, at 6:15 AM, Rob Cliffe wrote: So - the syntax restriction seems not only inconsistent, but pointless; it doesn't forbid anything, but merely means we have to do it in a slightly convoluted (unPythonesque) way. So please, Guido, will you reconsider? Ind

Re: [Python-Dev] Fuzziness in io module specs

2009-09-18 Thread MRAB
[Oops! Hit Send to soon] Pascal Chambon wrote: Hello everyone I'm currently working on a reimplementation of io.FileIO, which would allow cross-platform file range locking and all kinds of other safety features ; however I'm slightly stuck due to some specification fuzziness in the IO docs.

Re: [Python-Dev] Fuzziness in io module specs

2009-09-18 Thread MRAB
James Y Knight wrote: On Sep 18, 2009, at 3:55 PM, MRAB wrote: I think that this should be an invariant: 0 <= file pointer <= file size so the file pointer might sometimes have to be moved. As for the question of whether 'truncate' should be able to lengthen a file,

Re: [Python-Dev] Fuzziness in io module specs - PEP update proposition

2009-09-20 Thread MRAB
Pascal Chambon wrote: Hello After weighing up here and that, here is what I have come with. Comments and issue notifications more than welcome, of course. The exception thingy is not yet addressed. Regards, Pascal *Truncate and file pointer semantics* Rationale : The current implementati

Re: [Python-Dev] Fuzziness in io module specs

2009-09-20 Thread MRAB
Greg Ewing wrote: Pascal Chambon wrote: Concerning the naming of truncate(), would it be possible to deprecate it and alias it to "resize()" ? It's not very gratifying to have duplicated methods at the beginning of a major release, but I feel too that "truncate" is a misleading term, that h

Re: [Python-Dev] Fuzziness in io module specs - PEP update proposition

2009-09-20 Thread MRAB
Pascal Chambon wrote: Daniel Stutzbach a écrit : On Sun, Sep 20, 2009 at 4:48 AM, Pascal Chambon mailto:chambon.pas...@gmail.com>> wrote: *RawIOBase*.readinto(b: bytes) -> int "bytes" are immutable. The signature is: *RawIOBase*.readinto(b: bytearray) -> int Your efforts in working on

Re: [Python-Dev] unsubscriptable vs object does not support indexing

2009-09-22 Thread MRAB
Dino Viehland wrote: Is there a reason or a rule by which CPython reports different error message for different failures to subscript? For example: >>> set()[2] Traceback (most recent call last): File "", line 1, in TypeError: 'set' object does not support indexing >>> class c

Re: [Python-Dev] unsubscriptable vs object does not support indexing

2009-09-23 Thread MRAB
Janzert wrote: Steven D'Aprano wrote: On Thu, 24 Sep 2009 06:47:41 am Dino Viehland wrote: So I am +1 on unified the message and +1 on using the "does not support indexing" one. I'd be +1 on the unified message as well - but it seems what that message should be may be contentious (and quite a

Re: [Python-Dev] unsubscriptable vs object does not support indexing

2009-09-23 Thread MRAB
Ben Finney wrote: Steven D'Aprano writes: As far as I can see, in practice, people talk about obj[i] as the item at index i, not the item at subscript i -- the term "subscript" in this context seems to be rare to non-existent except for the error message. Presumably, the same people would al

Re: [Python-Dev] help required

2009-09-25 Thread MRAB
waqas ahmad wrote: Hi, I dont know it is the right place to post this question. I need help to change one search code line . can you help me please. here is my search method code: search=re.compile("^#acl InternationalGroup.*\n", re.M).search(pagetext) if search: ret=search.gr

Re: [Python-Dev] Fuzziness in io module specs - PEP update proposition V2

2009-09-27 Thread MRAB
Pascal Chambon wrote: Hello Below is a corrected version of the PEP update, adding the start/end indexes proposition and fixing functions signatures. Does anyone disagree with these specifications ? Or can we consider it as a target for the next versions of the io module ? I would have no pro

Re: [Python-Dev] IO module precisions and exception hierarchy

2009-09-27 Thread MRAB
Pascal Chambon wrote: > Found in current io PEP : > Q: Do we want to mandate in the specification that switching between > reading and writing on a read-write object implies a .flush()? Or is > that an implementation convenience that users should not rely on? > -> it seems that the only important

Re: [Python-Dev] summary of transitioning from % to {} formatting

2009-10-03 Thread MRAB
Steven Bethard wrote: I thought it might be useful for those who don't have time to read a million posts to have a summary of what's happened in the formatting discussion. The basic problem is that many APIs in the standard library and elsewhere support only %-formatting and not {}-formatting, e

Re: [Python-Dev] summary of transitioning from % to {} formatting

2009-10-03 Thread MRAB
Mark Dickinson wrote: On Sat, Oct 3, 2009 at 4:41 PM, Steven Bethard wrote: I thought it might be useful for those who don't have time to read a million posts to have a summary of what's happened in the formatting discussion. Definitely useful. Thanks for the summary! [...] * Add a parame

Re: [Python-Dev] summary of transitioning from % to {} formatting

2009-10-03 Thread MRAB
Antoine Pitrou wrote: MRAB mrabarnett.plus.com> writes: Another possibility: A StringFormat class with subclasses PercentStringFormat, BraceStringFormat, and perhaps DollarStringFormat. Or: A StringFormat class with methods parse_percent_format, parse_brace_format,

Re: [Python-Dev] transitioning from % to {} formatting

2009-10-03 Thread MRAB
Vinay Sajip wrote: Brett Cannon python.org> writes: Why don't we start something in the sandbox and see how far we can get. If no one beats me to it I will add the directory some time today and we can start hashing out the solution there. I've done a first cut of a converter from %-format t

Re: [Python-Dev] summary of transitioning from % to {} formatting

2009-10-03 Thread MRAB
Terry Reedy wrote: Steven Bethard wrote: I thought it might be useful for those who don't have time to read a million posts to have a summary of what's happened in the formatting discussion. definitely The basic problem is that many APIs in the standard library and elsewhere support only %-

Re: [Python-Dev] transitioning from % to {} formatting

2009-10-05 Thread MRAB
Vinay Sajip wrote: Raymond Hettinger rcn.com> writes: We should get one written. ISTM, every %-formatting string is directly translatable to an equivalent {}-formatting string. I'm not sure you can always get equivalent output from the formatting, though. For example: "%0#8x" % 0x1234 '0x

Re: [Python-Dev] transitioning from % to {} formatting

2009-10-08 Thread MRAB
Eric Smith wrote: Vinay Sajip wrote: BTW I sent Eric a private mail re. the "0o" versus "0" issue, to see if it was worth raising an enhancement request on the bug tracker using "O" to generate compatible rendering for octals. I didn't get your message, could you resend?. I was thinking the

Re: [Python-Dev] Logging, Unicode and sockets

2009-10-08 Thread MRAB
Vinay Sajip wrote: Thanks to http://bugs.python.org/issue7077 I've noticed that the socket-based logging handlers - SocketHandler, DatagramHandler and SysLogHandler - aren't Unicode-aware and can break in the presence of Unicode messages. I'd like to fix this by giving these handlers an option

Re: [Python-Dev] Top-posting on this list

2009-10-11 Thread MRAB
Masklinn wrote: On 11 Oct 2009, at 13:36 , Tarek Ziadé wrote: On Sun, Oct 11, 2009 at 1:26 PM, Ben Finney wrote: "Stephen J. Turnbull" writes: Trimming can be a PITA if you're using a crummy MUA How so? It merely requires the ability to navigate up and down by lines, and to select and del

Re: [Python-Dev] Possible language summit topic: buildbots

2009-10-25 Thread MRAB
David Bolen wrote: [snip] I think the other issue most likely to cause a perceived "downtime" with the Windows build slave that I've had a handful of cases over the past two years where the build slave appears to be operating properly, but the master seems to just queue up jobs as if it were down

Re: [Python-Dev] PEP 3003 - Python Language Moratorium

2009-11-05 Thread MRAB
Guido van Rossum wrote: On Tue, Nov 3, 2009 at 9:35 AM, Guido van Rossum wrote: I've checked draft (!) PEP 3003, "Python Language Moratorium", into SVN. As authors I've listed Jesse, Brett and myself. I haven't seen substantial opposition against the PEP -- in fact I can't recall any, and man

Re: [Python-Dev] PyPI comments and ratings, *really*?

2009-11-13 Thread MRAB
Matthew Woodcraft wrote: Steven D'Aprano wrote: Why do you think it is okay to combine the Disallow vote, without also combining the Allow vote? Less than a third of the total votes are in favour of disallowing comments, with two-thirds in favour of allowing them. I don't. I was giving one e

Re: [Python-Dev] global statements outside functions/methods should raise SyntaxError

2009-11-15 Thread MRAB
Benjamin Peterson wrote: 2009/11/15 Michael Foord : Well, personally I think it would be a good thing if this raised an exception during bytecode compilation - but it would fall under the moratorium and have to wait a few years. It could probably be considered a bug, though, since the global s

Re: [Python-Dev] Proposing PEP 386 for addition

2009-12-08 Thread MRAB
Terry Reedy wrote: Tarek Ziadé wrote: Hello, On behalf of the Distutils-SIG, I would like to propose PEP 386 for inclusion in the sdtlib, and have a final discussion here on Python-dev. http://www.python.org/dev/peps/pep-0386 Some English copy editor comments: "and it will optionally allow

Re: [Python-Dev] Splitting something into two steps produces different behavior from doing it in one fell swoop in Python 2.6.2

2009-12-11 Thread MRAB
John Arbash Meinel wrote: Roy Hyunjin Han wrote: While debugging a network algorithm in Python 2.6.2, I encountered some strange behavior and was wondering whether it has to do with some sort of code optimization that Python does behind the scenes. After initialization: defaultdic

Re: [Python-Dev] Proposing PEP 345 : Metadata for Python Software Packages 1.2

2009-12-27 Thread MRAB
Tarek Ziadé wrote: On Mon, Dec 28, 2009 at 1:41 AM, Sridhar Ratnakumar wrote: [..] Tarek, I am a bit confused at the current proposal combined with the newly introduced range operator. Would "Requires-Python: <=2.5" include 2.5.4 or not? <=2.5 means any version that is inferior or equal to

Re: [Python-Dev] Proposing PEP 345 : Metadata for Python Software Packages 1.2

2009-12-27 Thread MRAB
Ben Finney wrote: Tarek Ziadé writes: On Mon, Dec 28, 2009 at 1:41 AM, Sridhar Ratnakumar wrote: Also, "Requires-Python: 3" would include all 3.X versions, correct? Correct, because, "Requires-Python: 3" is equivalent to "Requires-Python: ~= 3" which is equivalent to "Requires-Python: 3.x.x

Re: [Python-Dev] Proposing PEP 345 : Metadata for Python Software Packages 1.2

2009-12-27 Thread MRAB
Martin v. Löwis wrote: No application developer will quickly figure out what a tilde means. Maybe it means 'roughly', but it requires too much thought and is ambiguous. 2.5 is not roughly 2.5.2. It is the same exactly. Before we had : Requires-Python: 2.5, 2.6 That made much more sense. It was

Re: [Python-Dev] Proposing PEP 345 : Metadata for Python Software Packages 1.2

2009-12-27 Thread MRAB
Arfrever Frehtes Taifersar Arahesis wrote: 2009-12-28 02:17:22 Ben Finney napisał(a): Tarek Ziadé writes: On Mon, Dec 28, 2009 at 1:41 AM, Sridhar Ratnakumar wrote: Also, "Requires-Python: 3" would include all 3.X versions, correct? Correct, because, "Requires-Python: 3" is equivalent to "

Re: [Python-Dev] Proposing PEP 345 : Metadata for Python Software Packages 1.2

2009-12-28 Thread MRAB
Antoine Pitrou wrote: David Lyon preisshare.net> writes: Requires a particular python version. > Requires-Python: 2.5:2.7 Why not drop ranges as well as operators and simply use commas? The above would be rewritten as: Requires-Python: 2.5, 2.6, 2.7 This would prevent the ambiguity on th

Re: [Python-Dev] Proposing PEP 345 : Metadata for Python Software Packages 1.2

2010-01-03 Thread MRAB
David Lyon wrote: On Mon, Dec 28, 2009 at 1:15 AM, Tarek Ziade wrote: This new operator removes the ambiguity the original proposal had, without making it more complex for common use cases. So if you dislike it, you will need to propose something else that also fixes the ambiguity we had. Ok.

[Python-Dev] GIL required for _all_ Python calls?

2010-01-06 Thread MRAB
Hi, I've been wondering whether it's possible to release the GIL in the regex engine during matching. I know that it needs to have the GIL during memory-management calls, but does it for calls like Py_UNICODE_TOLOWER or PyErr_SetString? Is there an easy way to find out? Or is it just a case of c

Re: [Python-Dev] Improve open() to support reading file starting with an unicode BOM

2010-01-07 Thread MRAB
Guido van Rossum wrote: I'm a little hesitant about this. First of all, UTF-8 + BOM is crazy talk. And for the other two, perhaps it would make more sense to have a separate encoding-guessing function that takes a binary stream and returns a text stream wrapping it with the proper encoding? Alte

Re: [Python-Dev] Improve open() to support reading file starting with an unicode BOM

2010-01-08 Thread MRAB
Victor Stinner wrote: Le vendredi 08 janvier 2010 05:21:04, Guido van Rossum a écrit : (...) (And yes, I know this happens. Doesn't mean we need to auto-guess by default; there are lots of issues e.g. what should happen after seeking to offset 0?) I wrote a new version of my patch (version 3):

Re: [Python-Dev] Quick sum up about open() + BOM

2010-01-08 Thread MRAB
Glenn Linderman wrote: On approximately 1/8/2010 3:59 PM, came the following characters from the keyboard of Victor Stinner: Hi, Thanks for all the answers! I will try to sum up all ideas here. One concern I have with this implementation encoding="BOM" is that if there is no BOM it assumes U

Re: [Python-Dev] Improve open() to support reading file starting with an unicode BOM

2010-01-11 Thread MRAB
Lennart Regebro wrote: On Mon, Jan 11, 2010 at 11:37, Walter Dörwald wrote: UTF-8 might be a good choice No, fallback if there is no BOM should be the local settings, just as fallback is today if you don't specify a codec. I mean, what if you want to look for a BOM but fall back to something

Re: [Python-Dev] [RELEASED] Python 2.7 alpha 2

2010-01-11 Thread MRAB
Lennart Regebro wrote: On Mon, Jan 11, 2010 at 10:06, "Martin v. Löwis" wrote: I know you are just looking for a compromise, but this shouldn't be it: the PSF has deliberately stayed out of the actual Python engineering, so the release that Benjamin makes is not done by the PSF (but by Benjamin

[Python-Dev] regex module

2010-01-12 Thread MRAB
Hi all, I'm back on the regex module after doing other things and I'd like your opinion on a number of matters: Firstly, the current re module has a bug whereby it doesn't split on zero-width matches. The BDFL has said that this behaviour should be retained by default in case any existing softwa

Re: [Python-Dev] regex module

2010-01-12 Thread MRAB
Terry Reedy wrote: On 1/12/2010 5:10 PM, MRAB wrote: Hi all, I'm back on the regex module after doing other things and I'd like your opinion on a number of matters: Firstly, the current re module has a bug whereby it doesn't split on zero-width matches. The BDFL has said that

Re: [Python-Dev] regex module

2010-01-12 Thread MRAB
MRAB wrote: Hi all, I'm back on the regex module after doing other things and I'd like your opinion on a number of matters: Firstly, the current re module has a bug whereby it doesn't split on zero-width matches. The BDFL has said that this behaviour should be retained by defa

Re: [Python-Dev] Proposed downstream change to site.py in Fedora (sys.defaultencoding)

2010-01-20 Thread MRAB
Martin v. Löwis wrote: The only supported default encodings in Python are: Python 2.x: ASCII Python 3.x: UTF-8 Is this true? For 3.x: yes. However, the default encoding is much less relevant in 3.x, since Python will never implicitly use the default encoding, except when some C module

Re: [Python-Dev] PEP 3147: PYC Repository Directories

2010-01-30 Thread MRAB
Ben Finney wrote: Vitor Bosshard writes: foo.py foo.pyc # < 2.7 or < 3.2 foo.27.pyc foo.32.pyc etc. This is simpler and more logical than the current subfolder proposal, as it is clear which version each file corresponds to. Python can use all the magic values it wants, but please don't spil

Re: [Python-Dev] PEP 3147: PYC Repository Directories

2010-01-31 Thread MRAB
Vitor Bosshard wrote: 2010/1/31 Georg Brandl : foo.py foo.pyr/ cpython-25.pyc cpython-25U.pyc cpython-27.pyc cpython-27U.pyc cpython-32.pyc unladen-011.pyc wpython-11.pyc +1. It should be quite easy to assign a new name every time the magic number is updated. If we don't change

Re: [Python-Dev] PEP 3147: PYC Repository Directories

2010-01-31 Thread MRAB
Reid Kleckner wrote: On Sun, Jan 31, 2010 at 8:34 AM, Nick Coghlan wrote: That still leaves the question of what to do with __file__ (for which even the solution in the PEP isn't particularly clean). Perhaps the thing to do there is to have __file__ always point to the source file and introduce

Re: [Python-Dev] PEP 3147: PYC Repository Directories

2010-01-31 Thread MRAB
Silke von Bargen wrote: That still leaves the question of what to do with __file__ (for which even the solution in the PEP isn't particularly clean). Perhaps the thing to do there is to have __file__ always point to the source file and introduce a __file_cached__ that points to the bytecompiled

Re: [Python-Dev] [issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-02-17 Thread MRAB
Vlastimil Brom wrote: Vlastimil Brom added the comment: I just tested the fix for unicode tracebacks and found some possibly weird results (not sure how/whether it should be fixed, as these inputs are indeed rather artificial...). (win XPp SP3 Czech, Python 2.6.4) Using the cmd console, the

[Python-Dev] Matching multiple regexes

2010-03-03 Thread MRAB
I've thought of a possible additional feature for my regex module and I'm looking for opinions. Occasionally there's a question about matching multiple regexes and someone might suggest combining them into one regex using "|". The feature would be to allow regex.compile, etc, to accept a list or

[Python-Dev] Odd lines in unicodedata_db.h

2010-04-03 Thread MRAB
I've just downloaded the daily snapshot at http://svn.python.org/snapshots/python.tar.bz2 In the header file /python/Modules/unicodedata_db.h, there are the following lines in the change_records_3_2_0 struct: { 255, 255, 255, 255, 1.0 }, { 255, 255, 255, 255, 2.0 }, { 25

Re: [Python-Dev] Odd lines in unicodedata_db.h

2010-04-04 Thread MRAB
Amaury Forgeot d'Arc wrote: 2010/4/4 MRAB : I've just downloaded the daily snapshot at http://svn.python.org/snapshots/python.tar.bz2 In the header file /python/Modules/unicodedata_db.h, there are the following lines in the change_records_3_2_0 struct: { 255, 255, 255

[Python-Dev] New regex module for 3.2?

2010-07-08 Thread MRAB
Hi all, I re-implemented the re module, adding new features and speed improvements. It's available at: http://pypi.python.org/pypi/regex under the name "regex" so that it can be tried alongside "re". I'd be interested in any comments or feedback. How does it compare with "re" in terms of s

Re: [Python-Dev] New regex module for 3.2?

2010-07-08 Thread MRAB
Nick Coghlan wrote: On Fri, Jul 9, 2010 at 5:52 AM, MRAB wrote: Hi all, I re-implemented the re module, adding new features and speed improvements. It's available at: http://pypi.python.org/pypi/regex under the name "regex" so that it can be tried alongside "re&quo

Re: [Python-Dev] New regex module for 3.2?

2010-07-08 Thread MRAB
Nick Coghlan wrote: On Fri, Jul 9, 2010 at 7:54 AM, MRAB wrote: You should be able to replace: import re with: import regex as re and still have everything work the same, ie it's backwards compatible with re. That's not what I'm asking. I'm asking what ha

Re: [Python-Dev] New regex module for 3.2?

2010-07-09 Thread MRAB
anatoly techtonik wrote: On Thu, Jul 8, 2010 at 10:52 PM, MRAB wrote: Hi all, I re-implemented the re module, adding new features and speed improvements. It's available at: http://pypi.python.org/pypi/regex under the name "regex" so that it can be tried alongside "re&

Re: [Python-Dev] New regex module for 3.2?

2010-07-09 Thread MRAB
Collin Winter wrote: On Fri, Jul 9, 2010 at 10:28 AM, MRAB wrote: anatoly techtonik wrote: On Thu, Jul 8, 2010 at 10:52 PM, MRAB wrote: Hi all, I re-implemented the re module, adding new features and speed improvements. It's available at: http://pypi.python.org/pypi/regex unde

[Python-Dev] Bug track down?

2010-11-07 Thread MRAB
It looks like the bug tracker is down. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

[Python-Dev] Is PyPI down?

2010-12-07 Thread MRAB
I can't get http://pypi.python.org and I've double-checked using http://downforeveryoneorjustme.com/. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/option

[Python-Dev] Can't compile regex module with Python 3.2

2010-12-08 Thread MRAB
The regex module calls _PyUnicode_IsWhitespace, which is mapped by unicodeobject.h to either _PyUnicodeUCS2_IsWhitespace or _PyUnicodeUCS4_IsWhitespace. From Python 2.5 to Python 3.1 the library pythonXX.lib contains either _PyUnicodeUCS2_IsWhitespace or _PyUnicodeUCS4_IsWhitespace. However, in

Re: [Python-Dev] Can't compile regex module with Python 3.2

2010-12-09 Thread MRAB
On 09/12/2010 05:57, Alexander Belopolsky wrote: On Thu, Dec 9, 2010 at 12:47 AM, "Martin v. Löwis" wrote: .. However, in Python 3.2b1 the library python32.lib contains only _PyUnicode_IsWhitespace, therefore breaking the build. Is this change intentional? If so, why does unicodeobject.h still

Re: [Python-Dev] Can't compile regex module with Python 3.2

2010-12-09 Thread MRAB
On 09/12/2010 23:35, Daniel Stutzbach wrote: On Wed, Dec 8, 2010 at 6:56 PM, MRAB mailto:pyt...@mrabarnett.plus.com>> wrote: Is this change intentional? If so, why does unicodeobject.h still do the mapping? In 3.2b1, unicodeobject.h doesn't map _PyUnicode_IsWhites

[Python-Dev] Locale-specific formatting

2010-12-17 Thread MRAB
I had a thought about locale-specific formatting. Currently, when we want to do locale-specific formatting we use the locale module like this: >>> locale.format("%d", 12345, grouping=False) '12345' >>> locale.format("%d", 12345, grouping=True) '12,345' This makes it harder to use more than one

Re: [Python-Dev] Locale-specific formatting

2010-12-18 Thread MRAB
On 18/12/2010 09:26, "Martin v. Löwis" wrote: Comments? How do you implement that? In particular, how do you retrieve information for different locales in a single program? The locale module would be able to return a named locale dict: >>> loc = locale.getnamedlocale('en_UK') or: >>> loc =

Re: [Python-Dev] Locale-specific formatting

2010-12-18 Thread MRAB
On 19/12/2010 00:31, "Martin v. Löwis" wrote: Am 18.12.2010 19:26, schrieb MRAB: On 18/12/2010 09:26, "Martin v. Löwis" wrote: Comments? How do you implement that? In particular, how do you retrieve information for different locales in a single program? The locale mod

Re: [Python-Dev] Strange occasional marshal error

2011-03-03 Thread MRAB
On 03/03/2011 15:09, Graham Stratton wrote: On Mar 2, 3:01 pm, Graham Stratton wrote: We are using marshal for serialising objects before distributing them around the cluster, and extremely occasionally a corrupted marshal is produced. The current workaround is to serialise everything twice and

[Python-Dev] Adding function checks to regex

2011-03-18 Thread MRAB
Some of those who are relative new to regexes sometimes ask how to write a regex which checks that a number is in a range or is a valid date. Although this may be possible, it certainly isn't easy. From what I've read, Perl has a way of including code in a regex, but I don't think that's a goo

[Python-Dev] urllib bug in Python 3.2.1?

2011-07-31 Thread MRAB
Someone over at StackOverflow has a problem with urlopen in Python 3.2.1: http://stackoverflow.com/questions/6892573/problem-with-urlopen/6892843#6892843 This is the code: from urllib.request import urlopen f = urlopen('http://online.wsj.com/mdc/public/page/2_3020-tips.html?mod=topnav

Re: [Python-Dev] Should we move to replace re with regex?

2011-08-26 Thread MRAB
On 27/08/2011 00:08, Tom Christiansen wrote: "M.-A. Lemburg" wrote on Sat, 27 Aug 2011 01:00:31 +0200: The good part is that it's based on the re code, the FUD comes from the fact that the new lib is 380kB larger than the old one and that's not even counting the generated 500kB of lookup t

[Python-Dev] Omission in re.sub?

2011-12-11 Thread MRAB
I've just come across an omission in re.sub which I hadn't noticed before. In re.sub the replacement string can contain escape sequences, for example: >>> repr(re.sub(r"x", r"\n", "axb")) "'a\\nb'" However: >>> repr(re.sub(r"x", r"\x0A", "axb")) "'ax0Ab'" Yes, it doesn't recognise "\xNN".

Re: [Python-Dev] Omission in re.sub?

2011-12-11 Thread MRAB
On 11/12/2011 20:27, Guido van Rossum wrote: On Sun, Dec 11, 2011 at 12:12 PM, MRAB wrote: I've just come across an omission in re.sub which I hadn't noticed before. In re.sub the replacement string can contain escape sequences, for example: repr(re.sub(r"x", r&q

Re: [Python-Dev] Omission in re.sub?

2011-12-11 Thread MRAB
On 11/12/2011 21:04, Guido van Rossum wrote: On Sun, Dec 11, 2011 at 12:47 PM, MRAB wrote: On 11/12/2011 20:27, Guido van Rossum wrote: On Sun, Dec 11, 2011 at 12:12 PM, MRAB wrote: I've just come across an omission in re.sub which I hadn't noticed before. In re.sub the replacem

Re: [Python-Dev] what is happening with the regex module going into Python 3.3?

2012-06-04 Thread MRAB
(I've been having trouble with my email recently, so I missed this thread amongst others.) I personally am no longer that bothered about whether the regex module makes it into stdlib, but I am still be maintaining it on PyPI. If someone else wants to integrate it I would, of course, be willing to

Re: [Python-Dev] what is happening with the regex module going into Python 3.3?

2012-06-04 Thread MRAB
On 05/06/2012 01:31, Steven D'Aprano wrote: MRAB wrote: I personally am no longer that bothered about whether the regex module makes it into stdlib, but I am still be maintaining it on PyPI. If someone else wants to integrate it I would, of course, be willing to help out. Ar

Re: [Python-Dev] what is happening with the regex module going into Python 3.3?

2012-06-05 Thread MRAB
On 05/06/2012 03:40, Terry Reedy wrote: On 6/4/2012 9:22 PM, MRAB wrote: I'm not planning any further changes to regex. I think it already has enough features... Do you have any idea where regex + Python stands in regard to Unicode TR18 support levels? http://unicode.org/reports

Re: [Python-Dev] TZ-aware local time

2012-06-05 Thread MRAB
On 06/06/2012 02:57, Alexander Belopolsky wrote: On Tue, Jun 5, 2012 at 7:11 PM, Greg Ewing wrote: What would be so bad about giving datetime objects a DST flag? Apps that don't care could ignore it and get results no worse than the status quo. This would neatly solve the round-trip proble

[Python-Dev] PyPI down?

2012-06-14 Thread MRAB
It looks like PyPI is down. :-( ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] cpython (2.7): Issue #15060: fix typo in socket doc; Patch by anatoly techtonik

2012-06-14 Thread MRAB
On 14/06/2012 15:15, Georg Brandl wrote: Am 13.06.2012 23:59, schrieb sandro.tosi: http://hg.python.org/cpython/rev/744fb52ffdf0 changeset: 77417:744fb52ffdf0 branch: 2.7 parent: 77408:60a7b704de5c user:Sandro Tosi date:Wed Jun 13 23:58:35 2012 +0200 summary:

Re: [Python-Dev] Raw string syntax inconsistency

2012-06-17 Thread MRAB
On 18/06/2012 00:55, Nick Coghlan wrote: On Mon, Jun 18, 2012 at 6:41 AM, Guido van Rossum wrote: Would it make sense to detect and reject these in 3.3 if the 2.7 syntax is used? Possibly - I'm trying not to actually *change* any of the internals of the string literal processing, though. (I

Re: [Python-Dev] [Python-checkins] cpython: Issue #14769: test_capi now has SkipitemTest, which cleverly checks

2012-06-22 Thread MRAB
On 22/06/2012 17:39, Terry Reedy wrote: On 6/22/2012 6:57 AM, larry.hastings wrote: http://hg.python.org/cpython/rev/ace45d23628a changeset: 77567:ace45d23628a user:Larry Hastings date:Fri Jun 22 03:56:29 2012 -0700 summary: Issue #14769: test_capi now has SkipitemTest, whi

Re: [Python-Dev] [Python-checkins] cpython: Issue #14769: test_capi now has SkipitemTest, which cleverly checks

2012-06-22 Thread MRAB
On 22/06/2012 21:45, Larry Hastings wrote: On 06/22/2012 01:29 PM, Terry Reedy wrote: Of course. And character 32 is also not usable and perhaps not worth testing. Au contraire! I grant you, it's hard to imagine how using it would be a good idea. But strictly speaking it is *usable*. (And

Re: [Python-Dev] 2.7 releases

2012-07-27 Thread MRAB
On 27/07/2012 20:12, Benjamin Peterson wrote: 2012/7/26 Thomas Heller : Will there be more 2.7 bugfix releases, and when the next one? Probably late fall or early 2013. Or, for those in the southern hemisphere, late spring or early 2013. ___ Python

Re: [Python-Dev] Question

2012-08-03 Thread MRAB
On 03/08/2012 19:53, Dheeraj Goswami wrote: Hi Python Gurus, I am an experienced Java developer and have been working on it for about 8 years. I need to build a web 2.0/AJAX based website/application and I am thinking to build it in Django which means I need to learn and move to Python. Please a

Re: [Python-Dev] issue 15510: textwrap.wrap() returning empty list

2012-08-03 Thread MRAB
On 03/08/2012 21:46, Chris Jerdonek wrote: I would like people's opinions on issue 15510, specifically whether it should be addressed and in what versions: http://bugs.python.org/issue15510 Jesús suggested that I ask. The issue relates to textwrap.wrap()'s behavior when wrapping strings that c

Re: [Python-Dev] No summary of tracker issues this week?

2012-08-05 Thread MRAB
On 05/08/2012 23:31, Mark Lawrence wrote: Hi all, I keep an eye open for this but can't find one for Saturday 03/08/2012. Have I missed it, has it been stopped, has something gone wrong with its production or what? I haven't seen it either. ___ Py

Re: [Python-Dev] python 2.7 + https + urlopen = ?

2012-08-12 Thread MRAB
On 13/08/2012 02:39, Python Urlopen wrote: [snip] After a lot of pain, I got myself out of this trouble, and my code now works correctly on 2.7.x (thanks to Jean-Paul Calderone's pyopenssl). But do "you" think this is a "feature" and not a "bug"? -- And do you think debating on this, killing

Re: [Python-Dev] Should urlencode() sort the query parameters (if they come from a dict)?

2012-08-18 Thread MRAB
On 18/08/2012 18:34, Guido van Rossum wrote: On Sat, Aug 18, 2012 at 6:28 AM, Christian Heimes wrote: Am 17.08.2012 21:27, schrieb Guido van Rossum: I wonder if it wouldn't make sense to change urlencode() to generate URLs that don't depend on the hash order, for all versions of Python that su

Re: [Python-Dev] why is _PyBytes_Join not public but PyUnicode_Join is?

2012-08-30 Thread MRAB
On 31/08/2012 02:43, Gregory P. Smith wrote: We have use for _PyBytes_Join in an extension module but technically it isn't a public Python C API... anyone know why? PyUnicode_Join is. Looking up the bytes 'join' method and using the C API to call that method object with proper parameters seems

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread MRAB
On 11/09/2012 13:06, Victor Stinner wrote: * Call builtin functions if arguments are constants. Examples: - len("abc") => 3 - ord("A") => 65 Does it preserve python semantics? What if you change the len builtin? This optimization is disabled by default (in the version 0.3), because built

Re: [Python-Dev] Release of astoptimizer 0.3

2012-09-11 Thread MRAB
On 11/09/2012 22:46, Victor Stinner wrote: 2012/9/11 Nick Coghlan : This is fine in an external project, but should never be added to the standard library. The barrier to semantic changes that break monkeypatching should be high. The version 0.3 has a known bug: "len=chr; print(len('A'))" is o

Re: [Python-Dev] "Decimal(2) != float(2)"???

2012-09-29 Thread MRAB
On 2012-09-30 01:43, Jan Kaliszewski wrote: Hello, In http://docs.python.org/release/3.2.3/reference/expressions.html#in we read: "[...] This can create the illusion of non-transitivity between supported cross-type comparisons and unsupported comparisons. For example, Decimal(2) == 2 and 2 == fl

Re: [Python-Dev] Stdlib and timezones, again

2012-09-30 Thread MRAB
On 2012-09-30 19:55, Serhiy Storchaka wrote: On 30.09.12 16:15, Antoine Pitrou wrote: Probably, but for most purposes I would guess a 2-year old database is still good enough? After all, you don't see many people complaining about the outdated Unicode database that is hard-wired in past Pythons.

Re: [Python-Dev] Proposed schedule for Python 3.4

2012-10-03 Thread MRAB
On 2012-10-03 16:28, Brian Curtin wrote: On Wed, Oct 3, 2012 at 10:13 AM, Larry Hastings wrote: On 10/03/2012 04:55 PM, Nick Coghlan wrote: Regardless of when the first alpha happens, I'll be promoting the hell out of it, begging for feedback on any of these changes that are available by then

<    1   2   3   4   5   6   >