[Python-Dev] Re: Updating inspect APIs

2022-04-17 Thread MRAB
On 2022-04-18 01:23, Steven D'Aprano wrote: On Sun, Apr 17, 2022 at 08:35:06PM +0100, MRAB wrote: You could return only the current attributes by default, but the extra attributes on demand. (Slightly strange, but backwards-compatible.) Slicing could also return what was requested, e

[Python-Dev] Re: Proto-PEP part 4: The wonderful third option

2022-04-26 Thread MRAB
On 2022-04-26 06:32, Larry Hastings wrote: Sorry, folks, but I've been busy the last few days--the Language Summit is Wednesday, and I had to pack and get myself to SLC for PyCon, &c. I'll circle back and read the messages on the existing threads tomorrow.  But for now I wanted to post "the

[Python-Dev] Re: PEP 689 – Semi-stable C API tier

2022-04-29 Thread MRAB
On 2022-04-29 18:02, Guido van Rossum wrote: On Fri, Apr 29, 2022 at 10:15 AM Petr Viktorin > wrote: On 29. 04. 22 16:32, Victor Stinner wrote: > Ok, let me start with the serious business: API name. > > I'm not comfortable with "semi-stable". Python

[Python-Dev] Re: PEP 689 – Semi-stable C API tier

2022-04-29 Thread MRAB
On 2022-04-30 03:17, Greg Ewing wrote: On 30/04/22 5:25 am, MRAB wrote: I was going to suggest "metastable". Too late? :-) What, the API is balanced on a knife edge and likely to collapse into something else if you sneeze too hard? There's a possibility that the universe migh

[Python-Dev] Re: [RELEASE] The first Python 3.11 beta (3.11.0b1) is available - Feature freeze is here

2022-05-08 Thread MRAB
On 2022-05-08 04:22, Pablo Galindo Salgado wrote: We did it, team!! After quite a bumpy release process and a bunch of last-time fixes, we have reached **beta 1** and **feature freeze**. What a ride eh? You can get the shiny new release artefacts from here: https://www.python.org/downloads/rel

[Python-Dev] Re: Raw strings ending with a backslash

2022-05-28 Thread MRAB
On 2022-05-28 13:17, Serhiy Storchaka wrote: 28.05.22 14:57, Damian Shaw пише: That PR seems to make \' and \" not special in general right? I think this is a more limited proposal, to only change the behavior when \ is at the end of a string, so the only behavior difference would never recei

[Python-Dev] Re: [OT] Re: Raw strings ending with a backslash

2022-05-28 Thread MRAB
On 2022-05-28 16:03, MRAB wrote: On 2022-05-28 13:17, Serhiy Storchaka wrote: 28.05.22 14:57, Damian Shaw пише: That PR seems to make \' and \" not special in general right? I think this is a more limited proposal, to only change the behavior when \ is at the end of a string, s

[Python-Dev] Re: [RELEASE] The cursed fourth Python 3.11 beta (3.11.0b4) is available

2022-07-14 Thread MRAB
On 13/07/2022 12:12, h.vetin...@gmx.com wrote: Also the GH bot is using DD/MM/ date format :-( whyy? Because github is international, and everyone but the US seems to agree that ``` /\ / \ /\ / day \ /\ / \

[Python-Dev] Re: Switching to Discourse

2022-07-21 Thread MRAB
On 21/07/2022 18:53, Mats Wichmann wrote: On 7/21/22 11:11, Mariatta wrote: On Thu, Jul 21, 2022 at 10:05 AM Skip Montanaro mailto:skip.montan...@gmail.com>> wrote: I have a perhaps stupid question. Is Discord the same as discuss.python.org , just by another

[Python-Dev] Adding new escapes to regex module

2022-08-16 Thread MRAB
Other regex implementations have escape sequences for horizontal whitespace (`\h` and `\H`) and vertical whitespace (`\v` and `\V`). The regex module already supports `\h`, but I can't use `\v` because it represents `\0x0b', as it does in the re module. Now that someone has asked for it, I'm

[Python-Dev] Re: Adding new escapes to regex module

2022-08-16 Thread MRAB
On 2022-08-16 22:14, Barry Scott wrote: > On 16 Aug 2022, at 21:24, MRAB wrote: > > Other regex implementations have escape sequences for horizontal whitespace (`\h` and `\H`) and vertical whitespace (`\v` and `\V`). > > The regex module already supports `\h`, but I can't

[Python-Dev] Re: Adding new escapes to regex module

2022-08-17 Thread MRAB
On 2022-08-17 08:25, Serhiy Storchaka wrote: 16.08.22 23:24, MRAB пише: Other regex implementations have escape sequences for horizontal whitespace (`\h` and `\H`) and vertical whitespace (`\v` and `\V`). The regex module already supports `\h`, but I can't use `\v` because it repre

[Python-Dev] Re: Adding new escapes to regex module

2022-08-17 Thread MRAB
On 2022-08-17 17:34, MRAB wrote: On 2022-08-17 08:25, Serhiy Storchaka wrote: 16.08.22 23:24, MRAB пише: Other regex implementations have escape sequences for horizontal whitespace (`\h` and `\H`) and vertical whitespace (`\v` and `\V`). The regex module already supports `\h`, but I can&#

[Python-Dev] Re: Possible bug in `re` module in Python 3.11?

2022-10-26 Thread MRAB
On 2022-10-26 09:17, Piotr Waszkiewicz wrote: Hi, I would like to ask your guidance as I'm entirely sure whether the problem I'm experiencing should be posted in CPython's repo as a bug issue. I've tried using newly released Python 3.11 interpreter in some of my projects and one of them failed

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread MRAB
On 2019-08-09 23:56, Steven D'Aprano wrote: I'm not trying to be confrontational, I'm trying to understand your use-case(s) and see if it would be broken by the planned change to string escapes. On Fri, Aug 09, 2019 at 03:18:29PM -0700, Glenn Linderman wrote: On 8/9/2019 2:53 PM, Steven D'Apra

[Python-Dev] Re: Spammy stuff (was Re: congrats on 3.5! Alas, windows 7 users are having problems installing it)

2019-09-15 Thread MRAB
On 2019-09-15 23:40, Michael Foord wrote: Sent from my iPhone On 15 Sep 2019, at 23:25, Tim Peters wrote: [Tim] While python-dev has several "official" moderators, best I can tell I'm the only one who has reviewed these messages for years. I should clarify that! That's not meant to be a

[Python-Dev] Re: static variables in CPython - duplicated _Py_IDENTIFIERs?

2019-09-23 Thread MRAB
On 2019-09-23 21:22, Vinay Sajip via Python-Dev wrote: OK - but that's just one I picked at random. There are others like it - what would be the process for deciding which ones need to be made private and moved? Should an issue be raised to track this? It's not really a question of which ones

[Python-Dev] Compacting the Uncompactable

2019-09-28 Thread MRAB
Here's a video about memory fragmentation and compaction that you might find interesting: "Compacting the Uncompactable" by Bobby Powers https://www.youtube.com/watch?v=c1UBJbfR-H0 ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe sen

[Python-Dev] Re: [RELEASE] Python 3.8.0 is now available

2019-10-15 Thread MRAB
On 2019-10-14 21:23, Łukasz Langa wrote: On behalf of the Python development community and the Python 3.8 release team, I’m pleased to announce *the availability of Python 3.8.0*. [snip] I've installed pywin32 on Python 3.8, but when I try to import win32clipboard it says it can't find it:

[Python-Dev] Re: [RELEASE] Python 3.8.0 is now available

2019-10-15 Thread MRAB
On 2019-10-15 19:03, MRAB wrote: On 2019-10-14 21:23, Łukasz Langa wrote: On behalf of the Python development community and the Python 3.8 release team, I’m pleased to announce *the availability of Python 3.8.0*. [snip] I've installed pywin32 on Python 3.8, but when I try to i

[Python-Dev] Re: Implementation of PEP-0604

2019-11-17 Thread MRAB
On 2019-11-17 20:09, Ivan Levkivskyi wrote: To add some more input about forward references, here are couple of thoughts: 1. I think ideally we should support forward references to the same extent they are currently supported: i.e. Union[None, "ForwardRef"], Union["OtherForwardRef", None], and

[Python-Dev] Re: Python 3.8 error?

2019-12-09 Thread MRAB
On 2019-12-09 18:22, Christian Tismer wrote: On 08.12.19 09:49, Nick Coghlan wrote: On Fri., 6 Dec. 2019, 3:31 am Christian Tismer, mailto:tis...@stackless.com>> wrote: Hi guys, during the last few weeks I have been struggling quite much in order to make PySide run with Python 3.8

[Python-Dev] Re: Request to postpone some Python 3.9 incompatible changes to Python 3.10

2020-01-31 Thread MRAB
On 2020-01-31 19:58, Ethan Furman wrote: On 01/31/2020 10:47 AM, Mike Miller wrote: On 2020-01-23 07:20, Victor Stinner wrote: Python 3.9 introduces many small incompatible changes which broke tons There's a well-known and established way of signaling breaking changes in software platforms

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-20 Thread MRAB
On 2020-03-20 21:49, Dennis Sweeney wrote: For clarity, I'll change If ``s`` does not have ``pre`` as a prefix, an unchanged copy of ``s`` is returned. to If ``s`` does not have ``pre`` as a prefix, then ``s.cutprefix(pre)`` returns ``s`` or an unchanged copy of ``s``. For consis

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-22 Thread MRAB
On 2020-03-22 05:00, Dennis Sweeney wrote: I like "removeprefix" and "removesuffix". My only concern before had been length, but three more characters than "cut***fix" is a small price to pay for clarity. How about "dropprefix" and "dropsuffix"? ___

[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-05-15 Thread MRAB
On 2020-05-15 20:36, David Mertz wrote: On Fri, May 15, 2020 at 12:55 PM Eric V. Smith > wrote: Also: The PEP says "At most one additional item may be consumed from one of the iterators when compared to normal zip usage." I think this should be prefaced wit

[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-05-20 Thread MRAB
On 2020-05-21 00:29, Emily Bowman wrote: Python has always preferred full-word over old-school C/Perl/PHP-style abbreviated names. Clarity is paramount. (Or this whole discussion wouldn't even be happening.) [snip] ... apart from len, def, int, float, str, etc. ___

[Python-Dev] Re: Repr: where to place the address and additional info?

2020-05-29 Thread MRAB
On 2020-05-29 21:02, Serhiy Storchaka wrote: The default repr of Python object is formatted using the following pattern: <{typename} object at {address:#x}> And many custom reprs use similar patterns, but add some additional type specific information. The type name first, followed by deta

[Python-Dev] Re: When can we remove wchar_t* cache from string?

2020-06-12 Thread MRAB
On 2020-06-12 09:32, Inada Naoki wrote: Hi, all. Py_UNICODE has been deprecated since PEP 393 (Flexible string representation). wchar_t* cache in the string object is used only in deprecated APIs. It waste 1 word (8 bytes on 64bit machine) per string instance. The deprecated APIs are documente

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-23 Thread MRAB
On 2020-06-23 17:01, Guido van Rossum wrote: I'm happy to present a new PEP for the python-dev community to review. This is joint work with Brandt Bucher, Tobias Kohn, Ivan Levkivskyi and Talin. Many people have thought about extending Python with a form of pattern matching similar to that fo

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-23 Thread MRAB
On 2020-06-23 20:27, Rob Cliffe via Python-Dev wrote: On 23/06/2020 17:01, Guido van Rossum wrote: You can combine several literals in a single pattern using `|` ("or"): ```py         case 401|403|404:             return "Not allowed" The PEP is great, but this strikes me as horribly confusi

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-23 Thread MRAB
On 2020-06-23 18:20, Antoine Pitrou wrote: Some comments: * What you call "Constant Value Patterns" can really refer to any local or non-local name, regardless of how complex the referred object is, right? Also, __eq__ is called in that case, not __match__? * If I understand correctly,

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-23 Thread MRAB
On 2020-06-23 22:53, Emily Bowman wrote: On Tue, Jun 23, 2020 at 2:10 PM MRAB <mailto:pyt...@mrabarnett.plus.com>> wrote: I think that's done for consistency. '_' is a wildcard and you can have:      case (_, _): to match any 2-tuple, so:      case

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-23 Thread MRAB
On 2020-06-23 22:50, Barry Warsaw wrote: On Jun 23, 2020, at 14:31, Chris Angelico wrote: I can't find it among the rejected alternatives, but was it considered to use "..." as the wildcard, rather than "_"? It carries similar meaning but its special case of "this will never be bound" is simpl

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-23 Thread MRAB
On 2020-06-24 01:09, Guido van Rossum wrote: On Tue, Jun 23, 2020 at 4:41 PM MRAB <mailto:pyt...@mrabarnett.plus.com>> wrote: [snip] However, what if you wanted to match Ellipsis? This could lead to bugs:  >>> ... Ellipsis  >>> Ellipsis

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-24 Thread MRAB
On 2020-06-24 13:37, Antoine Pitrou wrote: On Wed, 24 Jun 2020 21:54:24 +1200 Greg Ewing wrote: On 24/06/20 5:20 am, Antoine Pitrou wrote: > suddently `Point(x, 0)` means something entirely > different (it doesn't call Point.__new__, it doesn't lookup `x` in the > locals or globals...). Thi

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-24 Thread MRAB
On 2020-06-24 23:14, Ethan Furman wrote: On 06/24/2020 01:49 PM, Tim Peters wrote: I too thought "why not else:?" at first. But "case _:" covers it in the one obvious way after grasping how general wildcard matches are. "case _:" is easy to miss -- I missed it several times reading through th

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-25 Thread MRAB
On 2020-06-25 04:54, Greg Ewing wrote: I had another thought about a way to make the bound names explicit. # Keyword case Point(x -> px, y -> py): # Positional case Point(-> x, -> y): # Sub-pattern, positional case Line(Point() -> p1, Point() -> p2): # Sub-p

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-25 Thread MRAB
On 2020-06-25 08:50, Anders Munch wrote: Eric Nieuwland : I have some doubt about the keyword Guido van Rossum [mailto:gu...@python.org]: Many people have tried to come up with a different keyword here, but nothing has been found that comes even close to the simplicity of match. Plus, several

[Python-Dev] Re: Recent PEP-8 change

2020-07-02 Thread MRAB
On 2020-07-02 10:38, Chris Angelico wrote: On Thu, Jul 2, 2020 at 7:27 PM Antoine Pitrou wrote: Otherwise why stop at English? I could just as well write my comments in French if it's all about individual freedom. Requiring English is not inclusive, it forced people like me to painfully adapt

[Python-Dev] Re: Recent PEP-8 change

2020-07-02 Thread MRAB
On 2020-07-02 12:32, Greg Ewing wrote: On 2/07/20 10:53 pm, MRAB wrote: Alternatively, it could be an auxiliary language like Esperanto. Maybe Esperanto in particular wouldn't be the best choice -- I gather it's rather European-oriented. Maybe we should standardise on Klingon? Hum

[Python-Dev] Re: Recent PEP-8 change

2020-07-02 Thread MRAB
On 2020-07-02 15:19, Piper Thunstrom wrote: On Thu, Jul 2, 2020 at 10:01 AM Paul Moore wrote: What *is* the correct inclusive way to refer to an unidentified person in a technical document, without sacrificing clarity by using convoluted circumlocutions like "he/her/they" or over-use of the pas

[Python-Dev] Re: Flexible assignment targets

2020-07-02 Thread MRAB
On 2020-07-02 15:48, Jim J. Jewett wrote: Guido van Rossum wrote: On Wed, Jul 1, 2020 at 5:50 PM Nick Coghlan ncogh...@gmail.com wrote: > The key thing I'm hoping for in PEP 622 itself is > that "Syntactic compatibility with a possible future > enhancement to assignment statements" be considered

[Python-Dev] Re: Recent PEP-8 change

2020-07-02 Thread MRAB
On 2020-07-02 17:14, Paul Moore wrote: On Thu, 2 Jul 2020 at 16:53, David Mertz wrote: On Thu, Jul 2, 2020, 11:08 AM Piper Thunstrom Paul, this is actually a good question to ask. In general, singular "they" is becoming more popular. It's already used frequently for the singular indetermina

[Python-Dev] Re: Recent PEP-8 change

2020-07-02 Thread MRAB
On 2020-07-02 17:47, Piper Thunstrom wrote: On Thu, Jul 2, 2020 at 12:16 PM MRAB wrote: > Here's an article on singular 'they': > > https://public.oed.com/blog/a-brief-history-of-singular-they/ > > TL;DR: It's not a recent usage; it was OK in 1375. Forgive m

[Python-Dev] Re: Recent PEP-8 change

2020-07-02 Thread MRAB
On 2020-07-02 18:19, David Mertz wrote: On Thu, Jul 2, 2020 at 12:58 PM Piper Thunstrom > wrote: > TL;DR: It's not a recent usage; it was OK in 1375. Forgive me for not giving a detailed play by play of 15 years of experience specifically as a writer an

[Python-Dev] Re: [Python-ideas] Re: Amend PEP-8 to require clear, understandable comments instead of Strunk & White Standard English comments

2020-07-02 Thread MRAB
On 2020-07-02 22:17, Jeff Allen wrote: On 01/07/2020 21:01, Ethan Furman wrote: A not-great article, White Fears of Dispossession: Dreyer's English, The Elements of Style,and the Racial Mapping of English Discourse, here: http://radicalteacher.library.pitt.edu/ojs/radicalteacher/issue/view/19

[Python-Dev] Re: Recent PEP-8 change (Antoine Pitrou)

2020-07-03 Thread MRAB
On 2020-07-03 17:52, Jim J. Jewett wrote: Specifying British English (as opposed to just British spelling) would probably tempt people to use more Brit-only idioms, in the same way that Monty Python tempts people to make Flying Circus references. I don't love the idea of talking more about how

[Python-Dev] Re: Recent PEP-8 change

2020-07-04 Thread MRAB
On 2020-07-04 05:51, Greg Ewing wrote: On 4/07/20 4:33 am, Jim J. Jewett wrote: If Bob and Alice seem neutral to you, would you do a double-take on Kehinde or Oladotun? Maybe we should use randomly generated names for hypothetical persons? Ideally they should be short names, one or two syll

[Python-Dev] Re: [Python-ideas] Re: Amend PEP-8 to require clear, understandable comments instead of Strunk & White Standard English comments

2020-07-04 Thread MRAB
On 2020-07-04 16:23, Stephen J. Turnbull wrote: @Inada-sama: For RFC conformance to S&W, see footnote [3] at the end. MRAB writes: > If you believe you have something important to say, then at least > say it clearly. Indeed -- that commit log is an example of the kind of w

[Python-Dev] Re: Recent PEP-8 change

2020-07-04 Thread MRAB
On 2020-07-04 19:23, Paul Moore wrote: On Sat, 4 Jul 2020 at 17:48, MRAB wrote: > > On 2020-07-04 05:51, Greg Ewing wrote: > > On 4/07/20 4:33 am, Jim J. Jewett wrote: > >> If Bob and Alice seem neutral to you, would you do a double-take on Kehinde or Oladotun? > &

[Python-Dev] Re: [Python-ideas] Re: Amend PEP-8 to require clear, understandable comments instead of Strunk & White Standard English comments

2020-07-04 Thread MRAB
On 2020-07-04 21:07, Martin Dengler wrote: On Sat, Jul 04, 2020 at 05:51:04PM +0100, MRAB wrote: >I'd also add: Try to avoid regionalisms; aim for a >broadly "international" form of the language. Some How do you spell "regionalism"? Martin PS: Irony intended

[Python-Dev] Re: PEP 622 railroaded through?

2020-07-07 Thread MRAB
On 2020-07-08 02:20, Greg Ewing wrote: On 8/07/20 12:48 pm, Chris Angelico wrote: "for x[0] in iter:" uses x[0] as an assignment target, You're right, there are some others, but I think they're equally clear -- all the ones I can think of are directly after a keyword ("for", "as", "import", et

[Python-Dev] Re: PEP 622: Structural Pattern Matching -- followup

2020-07-08 Thread MRAB
On 2020-07-08 03:08, Rob Cliffe via Python-Dev wrote: Why not use '=' to distinguish binding from equality testing:     case Point(x, =y): # matches a Point() with 2nd parameter equal to y; if it does, binds to x. This would allow a future (or present!) extension to other relative operators:

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-11 Thread MRAB
On 2020-07-11 20:56, Steve Holden wrote: Given that case will be a keyword, what's the case (pun unintentional) for indenting the case clauses? What's wrong with 'case' and 'else' both indented the same as match? Without the keyword there'd be a case for indenting, but with it I don't see the n

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-11 Thread MRAB
On 2020-07-12 01:32, Chris Angelico wrote: On Sun, Jul 12, 2020 at 10:30 AM Greg Ewing wrote: Just had another thought about marking assignment targets. The PEP currently forbids repeating bound names in a pattern to avoid raising expectations that case Point(x, x): would match only if

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-12 Thread MRAB
On 2020-07-12 23:20, Guido van Rossum wrote: [snip] The need for a wildcard pattern has already been explained -- we really want to disallow `Point(x, y, y)` but we really need to allow `Point(z, _, _)`. Generating code to assign the value to `_` seems odd given the clear intent to *ignore* the

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-16 Thread MRAB
On 2020-07-16 17:37, Steve Holden wrote: While I understand the point of view that says that match ... : should encapsulate a sequence of indented suites, it seems to me that match/case/case/.../else has a natural affinity with try/except/except/.../finally/else, and nobody seems to think that

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-16 Thread MRAB
On 2020-07-16 19:05, Richard Damon wrote: On Jul 16, 2020, at 1:36 PM, Chris Angelico wrote: On Fri, Jul 17, 2020 at 3:25 AM Federico Salerno wrote: Tools should adapt to the language, not the other way around. If things had to be done the way they had always been done, without any change,

[Python-Dev] Re: How to customize CPython to a minimal set

2020-07-21 Thread MRAB
On 2020-07-21 06:33, Huang, Yang wrote: Hi, Guido Yes. Micropyhton is also in consideration. But sqlite3 is the first usage. There should be some additional features like numpy, scipy... Not sure if micropython supports well? Or is there a feasible way to strip CPython ? Thanks. You want

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-08-03 Thread MRAB
On 2020-08-03 05:21, Guido van Rossum wrote: Your point about wanting a way to use an unqualified name as a value pattern is not unreasonable, and as you may recall we had an elegant solution in version 1 of the PEP: a leading dot. However that was booed away by the critics, and there has been

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 chara

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

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 ch

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 contr

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 s

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 on

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 ex

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 E

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 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 that I can regenera

Re: [Python-Dev] Oddity PEP 0 key

2009-05-01 Thread MRAB
Benjamin Peterson wrote: 2009/5/1 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

Re: [Python-Dev] Oddity PEP 0 key

2009-05-01 Thread MRAB
Michael Foord wrote: MRAB wrote: Benjamin Peterson wrote: 2009/5/1 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 the

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 thin

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 &

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 thi

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

2009-05-06 Thread MRAB
Antoine Pitrou wrote: Martin v. Löwis 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 what t

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 some

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 mak

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 mailto:john.arbash.mei...@gmail.com>> wrote: Andrew Bennetts wrote: > Antoine Pitrou wrote: >> Robert Kern gmail.com > writes: >>> Since one may have more than one filesystem side-by-si

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 k

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 would

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 +0

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,

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 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 . for now. What about Antoine's idea about doing a quote() on the names ? From my point of

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

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 object.f

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

2009-06-15 Thread MRAB
Cameron Simpson wrote: On 16Jun2009 11:21, Greg Ewing 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 perl quite happily. In some c

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

2009-06-16 Thread MRAB
Cameron Simpson wrote: On 16Jun2009 02:18, MRAB 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, is curr

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 we

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 : 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 in in place of a file.

<    1   2   3   4   5   6   >