Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-22 Thread MRAB
Martin v. Löwis wrote: [snip] To convert non-decodable bytes, a new error handler python-escape is introduced, which decodes non-decodable bytes using into a private-use character U+F01xx, which is believed to not conflict with private-use characters that currently exist in Python codecs. The

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-23 Thread MRAB
Martin v. Löwis wrote: MRAB wrote: Martin v. Löwis wrote: [snip] To convert non-decodable bytes, a new error handler python-escape is introduced, which decodes non-decodable bytes using into a private-use character U+F01xx, which is believed to not conflict with private-use characters

[Python-Dev] Dates in python-dev

2009-04-24 Thread MRAB
Hi, I've recently subscribed to this list and received my first Summary of Python tracker Issues. What I find annoying are the dates, for example: ACTIVITY SUMMARY (04/17/09 - 04/24/09) 3 x double-digits (have we learned nothing from Y2K? :-)) with the _middle_ ones changing fastest! I

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-25 Thread MRAB
Martin v. Löwis wrote: If the bytes are mapped to single half surrogate codes instead of the normal pairs (low+high), then I can see that decoding could never be ambiguous and encoding could produce the original bytes. I was confused by Markus Kuhn's original UTF-8b specification. I have now

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-25 Thread MRAB
Martin v. Löwis wrote: I see two main user-oriented use cases for the resulting Unicode strings this PEP will produce on all systems: displaying a list of filenames for the user to select from (an open file dialog), and allowing a user to edit or supply a filename (a save dialog or a rename

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-28 Thread MRAB
James Y Knight wrote: On Apr 28, 2009, at 2:50 AM, Martin v. Löwis wrote: James Y Knight wrote: Hopefully it can be assumed that your locale encoding really is a non-overlapping superset of ASCII, as is required by POSIX... Can you please point to the part of the POSIX spec that says that

Re: [Python-Dev] PEP 383 (again)

2009-04-28 Thread MRAB
Martin v. Löwis wrote: Furthermore, I don't believe that PEP 383 works consistently on Windows, What makes you say that? PEP 383 will have no effect on Windows, compared to the status quo, whatsoever. You could argue that if Windows is actually returning UTF-16 with half surrogates that they

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-28 Thread MRAB
Glenn Linderman wrote: On approximately 4/28/2009 11:55 AM, came the following characters from the keyboard of MRAB: I've been thinking of python-escape only in terms of UTF-8, the only encoding mentioned in the PEP. In UTF-8, bytes 0x00 to 0x7F are decodable. UTF-8 is only mentioned

Re: [Python-Dev] a suggestion ... Re: PEP 383 (again)

2009-04-30 Thread MRAB
Martin v. Löwis wrote: OK, so why not adopt the Mono solution in CPython? It seems to produce valid unicode strings, removing at least one issue with PEP 383. It also means that IronPython and CPython actually would be compatible. See my other message. The Mono solution may not be what you

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-30 Thread MRAB
One further question: should the encoder accept a string like u'\xDCC2\xDC80'? That would encode to b'\xC2\x80', which, when decoded, would give u'\x80'. Does the PEP only guarantee that strings decoded from the filesystem are reversible, but not check what might be de novo strings?

Re: [Python-Dev] Proposed: add support for UNC paths to all functions in ntpath

2009-04-30 Thread MRAB
Larry Hastings wrote: Counting the votes for http://bugs.python.org/issue5799 : +1 from Mark Hammond (via private mail) +1 from Paul Moore (via the tracker) +1 from Tim Golden (in Python-ideas, though what he literally said was I'm up for it) +1 from Michael Foord +1 from

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-30 Thread MRAB
Barry Scott wrote: On 30 Apr 2009, at 05:52, Martin v. Löwis wrote: How do get a printable unicode version of these path strings if they contain none unicode data? Define printable. One way would be to use a regular expression, replacing all codes in a certain range with a question mark.

[Python-Dev] Oddity PEP 0 key

2009-05-01 Thread MRAB
I've just noticed an oddity in the key in PEP 0. Most letters are used more than once. Wouldn't it be clearer if different letters were used for Accepted and Active instead of them both being 'A', for example? - A - Accepted proposal - R - Rejected proposal W - Withdrawn proposal - D -

Re: [Python-Dev] PEP 383 and GUI libraries

2009-05-01 Thread MRAB
Zooko O'Whielacronx wrote: Following-up to my own post to correct a major error: On Thu, Apr 30, 2009 at 11:44 PM, Zooko O'Whielacronx zoo...@gmail.com wrote: Folks: My use case (Tahoe-LAFS [1]) requires that I am *able* to read arbitrary binary names from the filesystem and store them so

Re: [Python-Dev] Oddity PEP 0 key

2009-05-01 Thread MRAB
Benjamin Peterson wrote: 2009/5/1 MRAB goo...@mrabarnett.plus.com: I've just noticed an oddity in the key in PEP 0. Most letters are used more than once. Wouldn't it be clearer if different letters were used for Accepted and Active instead of them both being 'A', for example? - A - Accepted

Re: [Python-Dev] Oddity PEP 0 key

2009-05-01 Thread MRAB
Michael Foord wrote: MRAB wrote: Benjamin Peterson wrote: 2009/5/1 MRAB goo...@mrabarnett.plus.com: I've just noticed an oddity in the key in PEP 0. Most letters are used more than once. Wouldn't it be clearer if different letters were used for Accepted and Active instead of them both being

Re: [Python-Dev] Oddity PEP 0 key

2009-05-02 Thread MRAB
Alexander Belopolsky wrote: .. leaving just 'Rejected' and 'Replaced' to be disambiguated. 'X' or 'Z' for Rejected? Looks like a perfect start for a bikeshed discussion. :-) Are there Unicode codepoints for smilies? I'm thinking of :-) for 'Accepted' and :-( for 'Rejected'. :-)

Re: [Python-Dev] PEP 383 update: utf8b is now the error handler

2009-05-05 Thread MRAB
Stephen J. Turnbull wrote: Martin v. Löwis writes: I've updated the PEP accordingly. I have three substantive comments. First, although consequences for Python 3 byte interfaces (ie, none) are explicitly stated, as far as I can see this PEP could apply to Python 2 as well. I don't think

Re: [Python-Dev] PEP 383 update: utf8b is now the error handler

2009-05-05 Thread MRAB
Stephen J. Turnbull wrote: MRAB writes: I don't think people shouldn't be using non-ASCII-compatible encodings for locale encodings is a sufficient rationale for a hard error here. I mean, of course they *should* be using UTF-8. Maybe Python 3.1 should just go ahead and error

Re: [Python-Dev] PEP 383 update: utf8b is now the error handler

2009-05-06 Thread MRAB
M.-A. Lemburg wrote: Martin v. Löwis wrote: The name utf8b suggested in the PEP is not in line with the codec design Where is that design documented, and how exactly violates the name the design (chapter and verse, please). Martin, I designed the whole Python codec machinery, so even if this

Re: [Python-Dev] PEP 383 update: utf8b is now the error handler

2009-05-06 Thread MRAB
Antoine Pitrou wrote: Martin v. Löwis martin at v.loewis.de writes: Despite there being also an error handler called surrogates. People, perhaps we could end all the bikeshedding and call one of those handlers surrogates-pass and the other surrogates-escape, which sounds quite faithful to

Re: [Python-Dev] PEP 383 update: utf8b is now the error handler

2009-05-07 Thread MRAB
Martin v. Löwis wrote: Wouldn't renaming the existing surrogates handler be an incompatible change, and thus inappropriate? No - it's new in Python 3.1. So what do you think about Antoine's proposal? +1 Although it looks like it would be without the '-' for consistency with existing error

Re: [Python-Dev] PEP 383 update: utf8b is now the error handler

2009-05-07 Thread MRAB
Walter Dörwald wrote: Michael Urman wrote: [...] Well, there is a way to stack error handlers, although it's not pretty: [...] codecs.register_error(surrogates_then_replace, surrogates_then_replace) That mitigates my arguments significantly, although I'd rather see

Re: [Python-Dev] PEP 383 update: utf8b is now the error handler

2009-05-07 Thread MRAB
Terry Reedy wrote: Martin v. Löwis wrote: Given your explanation of what the new 'surrogates' handler does (pass rather than reject erroneous surrogates), I think 'surrogates_pass' is fine. Thus, I considoer that and 'surrogates_excape' the best proposal the best so far and suggest that you

Re: [Python-Dev] Easy way to detect filesystem case-sensitivity?

2009-05-08 Thread MRAB
Brett Cannon wrote: On Thu, May 7, 2009 at 18:56, John Arbash Meinel john.arbash.mei...@gmail.com mailto:john.arbash.mei...@gmail.com wrote: Andrew Bennetts wrote: Antoine Pitrou wrote: Robert Kern robert.kern at gmail.com http://gmail.com writes: Since one may have

Re: [Python-Dev] special method lookup: how much do we care?

2009-05-10 Thread MRAB
Michael Foord wrote: Nick Coghlan wrote: Benjamin Peterson wrote: A while ago, Guido declared that all special method lookups on new-style classes bypass __getattr__ and __getattribute__. This almost completely consistent now, and I've been working on patching up a few incorrect cases. I've

Re: [Python-Dev] py3k, cgi, email, and form-data

2009-05-11 Thread MRAB
Robert Brewer wrote: There's a major change in functionality in the cgi module between Python 2 and Python 3 which I've just run across: the behavior of FieldStorage.read_multi, specifically when an HTTP app accepts a file upload within a multipart/form-data payload. In Python 2, each part

Re: [Python-Dev] Shorter release schedule?

2009-05-12 Thread MRAB
Antoine Pitrou wrote: Hello, Just food for thought here, but seeing how 3.1 is going to be a real featureful schedule despite being released shortly after 3.0, wouldn't it make sense to tighten future release planning a little? I was thinking something like doing a major release every 12 months

Re: [Python-Dev] PEP 376 : Changing the .egg-info structure

2009-05-16 Thread MRAB
Glenn Linderman wrote: On approximately 5/16/2009 11:58 AM, came the following characters from the keyboard of P.J. Eby: At 11:17 AM 5/16/2009 -0700, Glenn Linderman wrote: On approximately 5/16/2009 9:55 AM, came the following characters from the keyboard of P.J. Eby: At 06:06 PM 5/16/2009

Re: [Python-Dev] PEP 376 : Changing the .egg-info structure

2009-05-17 Thread MRAB
Alexander Shigin wrote: В Сбт, 16/05/2009 в 23:15 +0100, MRAB пишет: FYI, on RISC OS '/' is a valid filename character and '.' is used as the directory separator. I'd probably say that TAB is s reasonable character to use, even though it's OK in POSIX; after all, should anyone really be using

Re: [Python-Dev] PEP 376 : Changing the .egg-info structure

2009-05-19 Thread MRAB
Tarek Ziadé wrote: On Sat, May 16, 2009 at 6:55 PM, P.J. Eby p...@telecommunity.com wrote: 1. Why ';' separation, instead of tabs as in PEP 262? Aren't semicolons a valid character in filenames? I am changing this into a tab. for now. What about Antoine's idea about doing a quote() on the

[Python-Dev] Arguments of MatchObject in re module

2009-05-25 Thread MRAB
I've just noticed an oddity of the re module while looking at the sources. I'll illustrate it below: import re p = re.compile(foo) help(p.match) Help on built-in function match: match(...) match(string[, pos[, endpos]]) -- match object or None. Matches zero or more characters at the

Re: [Python-Dev] Exception for setting attributes of built-in type

2009-06-14 Thread MRAB
Seo Sanghyeon wrote: Exception for setting attributes of built-in type differs between CPython and IronPython. This is not purely theoretical, as zope.interface tries to set Implements declaration as __implemented__ attribute of built-in type object, and excepts TypeError. Python 2.6.1

Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-15 Thread MRAB
Cameron Simpson wrote: On 16Jun2009 11:21, Greg Ewing greg.ew...@canterbury.ac.nz wrote: Cameron Simpson wrote: It seems like whenever I want to do some kind of opportunistic but non-blocking stuff with a remote service Do you actually do this with buffered streams? Sure, in C, python and

Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-16 Thread MRAB
Cameron Simpson wrote: On 16Jun2009 02:18, MRAB pyt...@mrabarnett.plus.com wrote: My itch is that peek() _feels_ like it should be look into the buffer but actually can block and/or change the buffer. Can block, but not if you don't want it too. You might just want to see what, if anything

Re: [Python-Dev] I am back

2009-07-02 Thread MRAB
Stefan Behnel wrote: s...@pobox.com wrote: Aahz On Wed, Jul 01, 2009, Brett Cannon wrote: Anything happen while I was gone that I should be aware of that is not covered in a PEP? Aahz Yes. In particular, Brett, you probably didn't hear that the King of Pop died last week.

Re: [Python-Dev] Mercurial migration: progress report (PEP 385)

2009-07-03 Thread MRAB
Terry Reedy wrote: Dirkjan Ochtman wrote: It needs to be decided where the hg repositories will live. I'd like to propose to keep the hgwebdir instance at hg.python.org. This is an accepted standard for many organizations, and an easy parallel to svn.python.org. The 2.7 (trunk) repo might live

Re: [Python-Dev] Experiment: Adding re to string objects.

2009-07-17 Thread MRAB
Sean Reifschneider wrote: I'm mailing this to python-dev because I'd like feedback on the idea of adding an re attribute to strings. I'm not sure if it's a good idea or not yet, but I figure it's worth discussion. The module mentioned here includes a class called restr() which allows you to

Re: [Python-Dev] Implementing File Modes

2009-07-27 Thread MRAB
Paul Moore wrote: 2009/7/27 Eric Pruitt eric.pru...@gmail.com: Hello, Since there was a bit of confusion last time, I'll start by saying I am working on the subprocess.Popen module for Google Summer of Code. One of the features I am implementing is a class so that a running process can stand

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 not that you have different modes

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

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

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

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 expression except expression if exception 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

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?

[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(rx, r\n, axb)) 'a\\nb' However: repr(re.sub(rx, r\x0A, axb)) 'ax0Ab' Yes, it doesn't recognise \xNN. Is there a reason for

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, MRABpyt...@mrabarnett.plus.com 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(rx, r\n,

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, MRABpyt...@mrabarnett.plus.com wrote: On 11/12/2011 20:27, Guido van Rossum wrote: On Sun, Dec 11, 2011 at 12:12 PM, MRABpyt...@mrabarnett.plus.com wrote: I've just come across an omission in re.sub which I

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

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. Are you

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/tr18

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 Ewinggreg.ew...@canterbury.ac.nz 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

[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 Tosisandro.t...@gmail.com date:Wed Jun 13 23:58:35

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 Rossumgu...@python.org 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

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 la...@hastings.org date:Fri Jun 22 03:56:29 2012 -0700 summary: Issue #14769: test_capi now

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 space 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*.

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

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 pyt...@mrabarnett.plus.com 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-08 Thread MRAB
Nick Coghlan wrote: On Fri, Jul 9, 2010 at 7:54 AM, MRAB pyt...@mrabarnett.plus.com 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

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 pyt...@mrabarnett.plus.com 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: [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 pyt...@mrabarnett.plus.com wrote: anatoly techtonik wrote: On Thu, Jul 8, 2010 at 10:52 PM, MRAB pyt...@mrabarnett.plus.com wrote: Hi all, I re-implemented the re module, adding new features and speed improvements. It's available

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

[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öwismar...@v.loewis.de 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

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 pyt...@mrabarnett.plus.com 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

[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 locale at

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 module would be able

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 Strattongrahamstrat...@gmail.com 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

[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

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

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. Lemburgm...@egenix.com 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

Re: [Python-Dev] Misc re.match() complaint

2013-07-15 Thread MRAB
On 16/07/2013 00:30, Gregory P. Smith wrote: On Mon, Jul 15, 2013 at 4:14 PM, Guido van Rossum gu...@python.org mailto:gu...@python.org wrote: In a discussion about mypy I discovered that the Python 3 version of the re module's Match object behaves subtly different from the Python

Re: [Python-Dev] Misc re.match() complaint

2013-07-15 Thread MRAB
On 16/07/2013 01:25, Guido van Rossum wrote: On Mon, Jul 15, 2013 at 5:10 PM, MRAB pyt...@mrabarnett.plus.com wrote: On 16/07/2013 00:30, Gregory P. Smith wrote: On Mon, Jul 15, 2013 at 4:14 PM, Guido van Rossum gu...@python.org mailto:gu...@python.org wrote: In a discussion about mypy

Re: [Python-Dev] Misc re.match() complaint

2013-07-17 Thread MRAB
On 17/07/2013 05:15, Stephen J. Turnbull wrote: Terry Reedy writes: On 7/15/2013 10:20 PM, Guido van Rossum wrote: Or is this something deeper, that a group *is* a new object in principle? No, I just think of it as returning a string That is exactly what the doc says

Re: [Python-Dev] Deprecating the formatter module

2013-08-14 Thread MRAB
On 14/08/2013 17:17, Eli Bendersky wrote: On Wed, Aug 14, 2013 at 9:09 AM, Nick Coghlan ncogh...@gmail.com mailto:ncogh...@gmail.com wrote: On 14 August 2013 11:55, Brett Cannon br...@python.org mailto:br...@python.org wrote: On Wed, Aug 14, 2013 at 11:47 AM, Nick Coghlan

Re: [Python-Dev] When to remove deprecated stuff

2013-08-15 Thread MRAB
On 15/08/2013 13:29, R. David Murray wrote: On Thu, 15 Aug 2013 11:22:14 +0200, Antoine Pitrou solip...@pitrou.net wrote: On Thu, 15 Aug 2013 11:16:20 +0200 Victor Stinner victor.stin...@gmail.com wrote: 2013/8/15 Antoine Pitrou solip...@pitrou.net: We don't have any substantial change in

Re: [Python-Dev] Accepted: PEP 446 -- Make newly created file descriptors non-inheritable

2013-08-28 Thread MRAB
On 28/08/2013 07:29, Paul Moore wrote: On 27 August 2013 23:17, Guido van Rossum gu...@python.org mailto:gu...@python.org wrote: Thanks for your tiresome work I'm guessing you meant tireless here :-) That depends. It might have been tiresome for the one doing it!

Re: [Python-Dev] unicodedata module is out of date

2013-09-06 Thread MRAB
On 06/09/2013 10:54, Andrew Miller wrote: The unicodedata module only contains data up to Unicode 5.2 (October 2009), so attempting to reference any character from a later version e.g: unicodedata.lookup(TURKISH LIRA SIGN) results in a KeyError. Also, it seems to be limited to properties in

Re: [Python-Dev] Add a transformdict to collections

2013-09-10 Thread MRAB
On 10/09/2013 20:08, Paul Moore wrote: On 10 September 2013 19:31, Antoine Pitrou solip...@pitrou.net wrote: I think it would be a flaw to have this detail implementation-defined. This would be like saying that it is implementation-defined which of A,B,C is returned from A and B and C if all

Re: [Python-Dev] Add a transformdict to collections

2013-09-10 Thread MRAB
On 10/09/2013 22:46, Antoine Pitrou wrote: On Tue, 10 Sep 2013 18:44:20 -0300 Joao S. O. Bueno jsbu...@python.org.br wrote: On 10 September 2013 18:06, Antoine Pitrou solip...@pitrou.net wrote: On Tue, 10 Sep 2013 17:38:26 -0300 Joao S. O. Bueno jsbu...@python.org.br wrote: On 10 September

Re: [Python-Dev] PEP 455: TransformDict

2013-09-13 Thread MRAB
On 14/09/2013 01:49, Steven D'Aprano wrote: On Fri, Sep 13, 2013 at 11:45:16PM +0200, Antoine Pitrou wrote: Ok, I have a better (IMO) proposal: d = TransformDict(str.casefold, {'Foo': 1}) d.getitem('foo') ('Foo', 1) d.getitem('bar') Traceback (most recent call last):

Re: [Python-Dev] PEP 455: TransformDict

2013-09-13 Thread MRAB
On 14/09/2013 02:40, Ethan Furman wrote: On 09/13/2013 06:25 PM, MRAB wrote: On 14/09/2013 01:49, Steven D'Aprano wrote: Is it more common to want both the canonical key and value at the same time, or to just want the canonical key? My gut feeling is that I'm likely to have code like

Re: [Python-Dev] PEP 455: TransformDict

2013-09-14 Thread MRAB
On 14/09/2013 05:47, Ethan Furman wrote: On 09/13/2013 08:18 PM, Steven D'Aprano wrote: You're missing that I'm not iterating over the entire dict, just some subset (data) that I got from elsewhere. Ah, okay. Between you and Antoine I am convinced that .getitem() is a good thing. So have

Re: [Python-Dev] Best practice for documentation for std lib

2013-09-23 Thread MRAB
On 23/09/2013 20:01, Terry Reedy wrote: On 9/22/2013 10:44 PM, Guido van Rossum wrote: Glad you like it. I still do, too, but I've given up hope to convince all core developers to stick to this style. :-( [me] ('Return' rather than 'Returns' is the current convention.) That's actually a

Re: [Python-Dev] Revert #12085 fix for __del__ attribute error message

2013-09-23 Thread MRAB
On 23/09/2013 22:19, Nick Coghlan wrote: On 24 Sep 2013 01:24, Antoine Pitrou solip...@pitrou.net mailto:solip...@pitrou.net wrote: On Mon, 23 Sep 2013 18:51:04 +1000 Nick Coghlan ncogh...@gmail.com mailto:ncogh...@gmail.com wrote: On 23 September 2013 18:45, Antoine Pitrou

Re: [Python-Dev] Revert #12085 fix for __del__ attribute error message

2013-09-24 Thread MRAB
On 24/09/2013 09:06, Nick Coghlan wrote: On 24 September 2013 17:34, Antoine Pitrou solip...@pitrou.net wrote: On Tue, 24 Sep 2013 17:25:10 +1000 Nick Coghlan ncogh...@gmail.com wrote: You are setting the bar unreasonably high for an error message that has to convey a complex concept in as

Re: [Python-Dev] Revert #12085 fix for __del__ attribute error message

2013-09-25 Thread MRAB
| method ignored? It explains fairly clearly what has | happened, and also indicates what do do about it -- | catch it in the __del__ method. | | Exception in __del__ caught and not propagated: | Georg On 24Sep2013 09:33, Glenn Linderman v+pyt...@g.nevcal.com wrote: | [MRAB]: | Why not just

Re: [Python-Dev] toolbar

2013-09-28 Thread MRAB
On 28/09/2013 12:28, Kevin Ngugi wrote: Hi, I just downloaded Python 3.3 top teach myself how to program, I am new to programming, but the guide I am using requires me to access the toolbar, which I cannot seem to find. How do I find it and have it displayed on the interface? I tried v 3.1 but

Re: [Python-Dev] PEP 455: TransformDict

2013-10-08 Thread MRAB
On 08/10/2013 19:02, Yuriy Taraday wrote: On Fri, Sep 13, 2013 at 10:40 PM, Antoine Pitrou solip...@pitrou.net mailto:solip...@pitrou.net wrote: Hello, Following the python-dev discussion, I've written a PEP to recap the proposal and the various arguments. It's inlined below, and

Re: [Python-Dev] On the dangers of giving developers the best resources

2013-10-08 Thread MRAB
On 08/10/2013 23:21, Tim Delaney wrote: On 9 October 2013 09:10, Guido van Rossum gu...@python.org mailto:gu...@python.org wrote: It's not actually so much the extreme waste that I'm looking to expose, but rather the day-to-day annoyances of stuff you use regularly that slows you

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-11 Thread MRAB
On 11/10/2013 18:39, Ethan Furman wrote: On 10/11/2013 09:43 AM, Barry Warsaw wrote: On Oct 11, 2013, at 06:27 PM, Georg Brandl wrote: Maybe to fit in with other verb-like APIs used as context managers: it's open() not opened(). open() predates context managers, but maybe we need a new

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-11 Thread MRAB
On 11/10/2013 19:41, Glenn Linderman wrote: On 10/11/2013 10:19 AM, Eric V. Smith wrote: On 10/11/2013 12:43 PM, Barry Warsaw wrote: On Oct 11, 2013, at 06:27 PM, Georg Brandl wrote: Maybe to fit in with other verb-like APIs used as context managers: it's open() not opened(). open()

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-12 Thread MRAB
On 12/10/2013 05:05, Ethan Furman wrote: On 10/11/2013 07:47 PM, Stephen J. Turnbull wrote: Nick Coghlan writes: (RDM is also right that the exception still has the effect of terminating the block early, but I view names as mnemonics rather than necessarily 100% accurate descriptions

Re: [Python-Dev] Updated PEP 454 (tracemalloc): no more metrics!

2013-10-24 Thread MRAB
On 24/10/2013 15:40, Kristján Valur Jónsson wrote: -Original Message- From: Nick Coghlan [mailto:ncogh...@gmail.com] Sent: 24. október 2013 12:44 To: Kristján Valur Jónsson Cc: Python Dev Subject: Re: [Python-Dev] Updated PEP 454 (tracemalloc): no more metrics! Not everything is a PC

[Python-Dev] Compiler security

2013-10-31 Thread MRAB
Has anybody here heard about this, and, if so, is it anything we should be thinking about: How your compiler may be compromising application security http://www.itworld.com/security/380406/how-your-compiler-may-be-compromising-application-security ___

Re: [Python-Dev] PEP 0404 and VS 2010

2013-11-20 Thread MRAB
On 20/11/2013 23:36, Christian Tismer wrote: Hey Barry, On 20.11.13 23:30, Barry Warsaw wrote: On Nov 20, 2013, at 09:52 PM, Christian Tismer wrote: Many customers are forced to stick with Python 2.X because of other products, but they require a Python 2.X version which can be compiled using

  1   2   3   4   5   6   >