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

2022-04-29 Thread Greg Ewing
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? -- Greg ___ Python-Dev mailing list --

[Python-Dev] Re: How about using modern C++ in development of CPython ?

2022-10-17 Thread Greg Ewing
suggest having a small kernel written in C, and write the rest using a tool similar to Cython that will take care of all the tricky reference counting for you. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email

[Python-Dev] Re: A proposal to modify `None` so that it hashes to a constant

2022-11-28 Thread Greg Ewing
that there were some internal language reasons to want stable dicts, e.g. so that the class dict passed to __prepare__ preserves the order in which names are assigned in the class body. Are there any such use cases for stable sets? -- Greg ___ Python-D

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-08 Thread Greg Ewing
Barry Warsaw wrote: Subclassing SyntaxError is then a pragmatic concession to the fact that "SyntaxError" also de facto means "CompilationError” Perhaps there should be a CompilationError tghat SyntaxError and TargetScopeError are subclass

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Greg Ewing
x ... x = 5 ... File "", line 2 SyntaxError: no binding for nonlocal 'x' found We seem to be happy to use a plain SyntaxError for that, not even bothering with a subclass. So I'm inclined to agree that TargetScopeError is not necessary. -- Greg __

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

2019-08-10 Thread Greg Ewing
. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev

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

2019-08-10 Thread Greg Ewing
better to introduce a new string prefix, e.g. 'v' for 'verbatim': v"C:\Users\Fred\" -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://ma

[Python-Dev] Re: An f-string issue [Was: Re: Re: What to do about invalid escape sequences]

2019-08-10 Thread Greg Ewing
er, the backslash prohibition seems to apply even to this use in f-strings: >>> f"quote: {ord('\"')}" File "", line 1 SyntaxError: f-string expression part cannot include a backslash So it seems that f-strings are even more

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

2019-08-12 Thread Greg Ewing
Eric V. Smith wrote: I'm not in any way serious about this. I just want people to realize how many wacky combinations there would be. It doesn't matter how many combinations there are, as long as multiple prefixes combine in the way you would expect, which they do as far as I can see

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

2019-08-15 Thread Greg Ewing
If we want a truly raw string format that allows all characters, including any kind of quote, we could take a tip from Fortran: s = 31HThis is a "totally raw" string! -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubs

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Greg Ewing
spent more time discussing it than it will cost to keep it for the rest of Python's lifetime. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/p

[Python-Dev] Re: PEP 611: The one million limit.

2019-12-06 Thread Greg Ewing
pace. If anything is to be criticised, it's Intel's decision to only add 4 more address bits when going from an 8-bit to a 16-bit architecture. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to pyt

[Python-Dev] Re: Adding a scarier warning to object.__del__?

2020-01-04 Thread Greg Ewing
n-depth understanding of the issues. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.

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

2020-03-23 Thread Greg Ewing
e these in Python code. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/arc

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

2020-03-24 Thread Greg Ewing
exactly matched all the details of the actual implementation, nor was it intended to. The prose turned out to be much more readable, anway.:-) -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le

[Python-Dev] Re: PEP 617: New PEG parser for CPython

2020-04-02 Thread Greg Ewing
e needs to be a section in the PEP justifying the choice of PEG over the alternatives. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python

[Python-Dev] Re: PEP 617: New PEG parser for CPython

2020-04-02 Thread Greg Ewing
On 3/04/20 10:33 am, Victor Stinner wrote: I also like the fact that PEG is deterministic, whereas LL(1) parsers are not. Where do you get that LL(1) parsers are not deterministic? That's news to me! -- Greg ___ Python-Dev mailing list -- pytho

[Python-Dev] Re: PEP 617: New PEG parser for CPython

2020-04-02 Thread Greg Ewing
e grammar as a whole still needs to be unambiguous. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Messag

[Python-Dev] Re: PEP 617: New PEG parser for CPython

2020-04-02 Thread Greg Ewing
all of Wirth's languages after Pascal changed the syntax so as not to have a dangling else problem.) Personally I would rather my parser generator *did* complain about ambiguities, so that I can facepalm myself for designing my language in such a stupid way. -- Greg _

[Python-Dev] Re: PEP 617: New PEG parser for CPython

2020-04-03 Thread Greg Ewing
king PEG parser today. :) Even if the section only says "We didn't consider any alternatives, because...", I still think it should be there. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to pyt

[Python-Dev] Re: PEP 617: New PEG parser for CPython

2020-04-05 Thread Greg Ewing
input and then only being able to say "Something is wrong somewhere in this file." -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/

[Python-Dev] Re: PEP 617: New PEG parser for CPython

2020-04-05 Thread Greg Ewing
individual parsing functions can report an error, because there might be another branch higher up that succeeds. Does it keep track of the maximum distance it got through the source or something like that? -- Greg ___ Python-Dev mailing list -- python-dev@

[Python-Dev] Re: PEP 617: New PEG parser for CPython

2020-04-06 Thread Greg Ewing
qually powerful. I'm sure there will be other ways to parse the same language. That's certainly true now, but can you be sure it will remain true if additions are made that rely on the full power of PEG? -- Greg ___ Python-Dev mailing list --

[Python-Dev] Re: PEP 617: New PEG parser for CPython

2020-04-06 Thread Greg Ewing
thought of using it as a keyword later". To reduce arbitrariness, we would either have to make *all* keywords context-sensitive, or come up with some principled way of deciding whether a given keyword should be reserved or not. -- Greg ___ Python-

[Python-Dev] Re: PEP 617: New PEG parser for CPython

2020-04-06 Thread Greg Ewing
Another point in favour of always-reserved keywords is that they make life a lot easier for syntax highlighters. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https

[Python-Dev] Re: PEP 554 comments

2020-04-18 Thread Greg Ewing
channel with readiness callbacks, you can implement a buffered channel on top of it. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python

[Python-Dev] Re: PEP 554 comments

2020-04-20 Thread Greg Ewing
tly most of the time. Some user-friendly high-level things such as buffered channels would be provided. Efficiency is a secondary consideration. If it turns out to be a problem, that can be addressed later. -- Greg ___ Python-Dev mailing list -- python

[Python-Dev] Re: PEP 554 comments

2020-04-20 Thread Greg Ewing
esn't mean it isn't going to be used in the future, so isn't this wildly wrong? -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/li

[Python-Dev] Re: PEP 554 comments

2020-04-21 Thread Greg Ewing
ay as well expose it as part of the official API. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived

[Python-Dev] Re: PEP 554 comments

2020-04-21 Thread Greg Ewing
ated than that? You seem to be worried about channels getting leaked if someone forgets to close them. But it's just the same for files and pipes, and nobody seems to worry about that. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To

[Python-Dev] Re: PEP 554 for 3.9 or 3.10?

2020-04-21 Thread Greg Ewing
y the GIL, rather than things like blocking I/O calls that can release the GIL. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.pytho

[Python-Dev] Re: PEP 554 for 3.9 or 3.10?

2020-04-21 Thread Greg Ewing
ing every extension module that defines its own Python types and was written before PyType_FromSpec existed. I expect there is a huge number of those. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev

[Python-Dev] Re: PEP 554 comments

2020-04-21 Thread Greg Ewing
at close() should do what the PEP defines release() as doing, and release() shouldn't exist. I don't see why an interpreter needs the ability to close a channel for any *other* interpreter. There is no such ability for files and pipes. -- Greg _

[Python-Dev] Re: PEP 554 for 3.9 or 3.10?

2020-04-21 Thread Greg Ewing
programming in the middle of a lethal minefield. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message arc

[Python-Dev] Re: PEP 554 comments

2020-04-29 Thread Greg Ewing
multaneously. Of course you have to be careful about how you interleave the reads and writes if you do that. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.o

[Python-Dev] Re: Adding a "call_once" decorator to functools

2020-04-29 Thread Greg Ewing
On 30/04/20 3:29 pm, Raymond Hettinger wrote: Do you think it is safe to hold a non-reentrant lock across an arbitrary user function? I think what's wanted here is to block if it's locked by a different thread, but raise an exception if it's locked by the same t

[Python-Dev] Re: PEG parser and raw strings

2020-05-28 Thread Greg Ewing
any case, this is a function of the tokeniser, which I understand isn't being replaced at this stage. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.

[Python-Dev] Re: How to specify optional support of arguments

2020-06-14 Thread Greg Ewing
ir_fd'): ... -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/

[Python-Dev] Re: REPL output bug

2020-06-15 Thread Greg Ewing
On 16/06/20 12:20 pm, Steven D'Aprano wrote: The whole point of the REPL is to evaluate an expression and have the result printed. (That's the P in REPL :-) Still, it's a bit surprising that it prints results of expressions within a compound statement, not just at the top

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

2020-06-24 Thread Greg Ewing
-- is it possible to combine '=' and ':=' to match a keyword argument with a sub pattern and capture the result? I.e. can you write case Spam(foo = foo_value := Blarg()): ? -- Greg Obviously, there are cases where this is worthwhile, but still. It may be useful to t

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

2020-06-24 Thread Greg Ewing
suite by stacking them: case 401: case 402: case 403: ... Or perhaps both. The stacking option could be useful if the cases are complicated. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to

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

2020-06-24 Thread Greg Ewing
he syntax in the PEP currently allows it to be used that way, but it could do). -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.o

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

2020-06-24 Thread Greg Ewing
the ``match`` block was entered. Does that mean the pattern matching logic is in cahoots with collections.defaultdict? What if you want to match against your own defaultdict-like type? -- Greg ___ Python-Dev mailing list -- python-dev@python.org To

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

2020-06-24 Thread Greg Ewing
ot;ADT" as "Abstract Data Type" and totally missed that you were using it for something different. I think it would be better to just call them "algebraic types" (which is the term I learned) and not use an acronym. -- Greg ___ Py

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

2020-06-24 Thread Greg Ewing
art: Point() -> p1, end: Point() -> p2): -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://

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

2020-06-24 Thread Greg Ewing
ucting the same object more than one way, but your case would be more persuasive if you could come up with a side-effect-free example. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python

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

2020-06-24 Thread Greg Ewing
that it might be using some private feature of collections.defaultdict to get the specified behaviour. But if it's only using the standard mapping protocol, I don't think it matters exactly how it's using it. -- Greg ___ Python-Dev mailin

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

2020-06-24 Thread Greg Ewing
ike Point(x = a) and decide whether x or a or neither was being assigned to. Which makes me think there should be something *really* clear and unambiguous to indicate when assignment is happening. -- Greg ___ Python-Dev mailing list -- python-dev@python

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

2020-06-24 Thread Greg Ewing
On 25/06/20 4:24 pm, Emily Bowman wrote: There's always making everyone equally annoyed, and allowing 'case else:' Visual Basic does actually use "case else". (And "select case" at the beginning, just to be

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

2020-06-25 Thread Greg Ewing
3: ...; end If we did that in Python it would look like this: case shape: Point(x, y): ... Line(x1, y1, x2, y2): ... Circle(cx, cy, r): ... What think folks of this? -- Greg ___ Python-Dev mailing

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

2020-06-25 Thread Greg Ewing
he effect of matching anything. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.pytho

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

2020-06-25 Thread Greg Ewing
would be regarding _ as a "value that matches anything" rather than a "name that doesn't get assigned to". -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org ht

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

2020-06-25 Thread Greg Ewing
On 26/06/20 12:31 pm, Brandt Bucher wrote: I'd imagine that we either find some straightforward way of > opting-in to the current default behavior Maybe special-case 'self' in __match_args__ to mean the object being matched? -- Greg

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

2020-06-26 Thread Greg Ewing
matching that works that way. I think the intention is to leave open the possibility of implementing it in the future. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https

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

2020-06-26 Thread Greg Ewing
On 26/06/20 2:10 pm, Gregory P. Smith wrote: match get_shape() as shape:   case start, end := Line@(shape): This looks just as inscrutable to me in its own way. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an

[Python-Dev] Re: The Anti-PEP

2020-06-26 Thread Greg Ewing
confused about overall opinion tallies?  one way to find out... Maybe there should be a section in each PEP for counter-arguments that is maintained by another appointed person, independent of the PEP author and its sponsor. The position could be called "Devil&#

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

2020-06-26 Thread Greg Ewing
On 26/06/20 5:45 pm, Ned Deily wrote: Hasn't "|" been used in a similar way for decades in Unix/POSIX shell patterns, including with the shell case statement? Yes, but I regard Unix shell syntaxes as just plain weird and not a good model for designing a langua

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

2020-06-26 Thread Greg Ewing
an take a single argument should be required to implement the corresponding match behaviour explicitly. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/li

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

2020-06-29 Thread Greg Ewing
default single-positional-argument deconstruction is probably a bad idea, because it will be wrong for a large number of existing classes.) -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-l

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

2020-06-30 Thread Greg Ewing
t to have one on your shelf, as long as you keep it to yourself... or something? You can't have it both ways. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.p

[Python-Dev] Re: PEP 622 (match statement) playground

2020-07-01 Thread Greg Ewing
On 2/07/20 4:54 am, Brandt Bucher wrote: It sounds like you want to add "global z" to the top of the function definition. Or more likely, change the last case to 'case _'. -- Greg ___ Python-Dev mailing list -- python-dev@pytho

[Python-Dev] Re: PEP 622 (match statement) playground

2020-07-01 Thread Greg Ewing
On 2/07/20 9:25 am, Matthias Bussonnier wrote: It's still weird user experience as if you swap case .z and case z you don't get the Unbound error anymore. It also won't work as intended, because 'case z' will always match and it will never g

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

2020-07-02 Thread Greg Ewing
difficult. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/

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

2020-07-02 Thread Greg Ewing
gh many style guides continue to describe it as colloquial and less appropriate in formal writing." Personally I'd go with that and tell any prescriptivists who object to go and jump in a bitbucket. -- Greg ___ Python-Dev mailing list -- python

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

2020-07-03 Thread Greg Ewing
id from English classes. But French grammar is a lot closer to English than Latin is, so I don't usually suffer from much confusion. :-) -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le

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

2020-07-03 Thread Greg Ewing
Maybe the indeterminate use of "he" was influenced by French? In French there are no neutral pronouns at all, and the masculine ones are used for indeterminate and mixed genders. -- Greg ___ Python-Dev mailing list -- python-dev@python

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

2020-07-03 Thread Greg Ewing
On 4/07/20 4:52 am, Jim J. Jewett wrote: Specifying British English "British English" is woefully underspecified -- there are probably more variants of English used in Britain than in the rest of the world put together. -- Greg ___

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

2020-07-03 Thread Greg Ewing
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? -- Greg ___ Python-Dev mailing list -- python

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

2020-07-04 Thread Greg Ewing
On 5/07/20 3:26 am, Stephen J. Turnbull wrote: Greg Ewing writes: > Maybe we should use randomly generated names for hypothetical > persons? Randomly generated according to what character repertoire and lexical rules (I'm not talking about British v. American)? Randomly se

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

2020-07-04 Thread Greg Ewing
oblem. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/pytho

[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 Greg Ewing
On 5/07/20 8:30 am, MRAB wrote: On 2020-07-04 21:07, Martin Dengler wrote: How do you spell "regionalism"? As far as I'm aware, there's only one way to spell it, I suppose there could be some planet where it's spelle

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

2020-07-04 Thread Greg Ewing
you saying that people who split infinitives are usually black, and the people who look down on them are white? If so, it would seem that Strunk is actually standing up for black people here. (I don't actually believe this has anything to do with race, I'm just trying *to fully understand*

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

2020-07-05 Thread Greg Ewing
On 6/07/20 2:56 am, Stephen J. Turnbull wrote: Thing is, I'm sure I've used Americanisms and even the dreaded Academic Register, but I sure never noticed them! :-) Or, in non-American, "surely never noticed them". :-) -- Greg __

[Python-Dev] Re: PEP 622: Structural Pattern Matching [was: PEP 622 railroaded through?]

2020-07-07 Thread Greg Ewing
stead of ".name" as well? It would work better if ? were used to mark assigned names instead of values. Then '?' on its own would be a special case of '?name' where you leave out the name. -- Greg ___ Python-Dev mailing list --

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

2020-07-07 Thread Greg Ewing
operator, either = or :=. The PEP proposes to intermingle them, with only very subtle clues, such as the presence or absence of dots, to distinguish them. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev

[Python-Dev] Re: PEP 622: Structural Pattern Matching [was: PEP 622 railroaded through?]

2020-07-07 Thread Greg Ewing
s you choose names which "look constant-like" somehow. It also has the general problem of const-declarations in Python. Currently the compiler only has to analyse one module at a time; this would require it to also look inside imported modules to determine whether things were declared

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

2020-07-07 Thread Greg Ewing
hing different. Also I don't like the idea of being *forced* to use a namespace for my constants, regardless of how good an idea the PEP authors think it is. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to p

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

2020-07-08 Thread Greg Ewing
case C(x) if x == a.b: ... -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.pyth

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

2020-07-08 Thread Greg Ewing
On 9/07/20 3:30 am, Luciano Ramalho wrote: I strongly favor the option of aligning the `else` clause with `match`, because `else` is a special clause therefore it should look special. But on the other hand, it's semantically equivalent to 'case _:', so it's not all th

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

2020-07-10 Thread Greg Ewing
e footing semantically, just as they are in an "if" statement. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org

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

2020-07-11 Thread Greg Ewing
fault: ... } or like this: switch (x) { case 1: ... case 2: ... default: ... } This suggests to me that most people think of the cases as being subordinate to the switch, and the default being on the same level as the other cases. -- Greg _

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

2020-07-11 Thread Greg Ewing
On 11/07/20 11:20 pm, Paul Sokolovsky wrote: On Sat, 11 Jul 2020 22:49:09 +1200 Greg Ewing wrote: or like this: switch (x) { case 1: ... case 2: ... default: ... } Oh really, you never saw that? Well, they say that any programmer should

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

2020-07-11 Thread Greg Ewing
case Point(?x, x): and it would work as expected. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at

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

2020-07-11 Thread Greg Ewing
On 12/07/20 7:03 am, Federico Salerno wrote: On 11/07/2020 12:49, Greg Ewing wrote:    switch (x) {    case 1:   ...    case 2:   ...    default:   ...    } > I think that last one would be perceived as ok if it weren't for the brackets: everyone naturally indents an

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

2020-07-11 Thread Greg Ewing
setup? Do you have to write match poly: pass case ... ? -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.pytho

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

2020-07-11 Thread Greg Ewing
Is there anywhere else where Python goes out of its way to provide two ways of doing the same thing just because they might feel semantically different? -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-

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

2020-07-12 Thread Greg Ewing
d the compiler know that it was calling the builtin locals function and not something else? -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/p

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

2020-07-12 Thread Greg Ewing
On 13/07/20 3:28 pm, Devin Jeanpierre wrote: The compiler changes what local variables exist if there is a read from a variable named 'super', That's fairly harmless if there's a false positive. But accidentally getting all your locals de-optimised would b

[Python-Dev] Re: PEP 622: capturing into an explicit namespace

2020-07-17 Thread Greg Ewing
otentially change from one match statement to another. I have trouble seeing this as an improvement over just picking a character to use for the marking. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python

[Python-Dev] Re: Deferred, coalescing, and other very recent reference counting optimization

2020-09-01 Thread Greg Ewing
depends on how non-thread-safe it is. If it's "weird things can happen" it might be all right. But if it's "can crash the interpreter" it might not be all right. -- Greg ___ Python-Dev mailing list -- python-dev@python.org T

[Python-Dev] Re: Deferred, coalescing, and other very recent reference counting optimization

2020-09-01 Thread Greg Ewing
On 2/09/20 6:11 pm, Neil Schemenauer wrote: Weird things would include unexpected exceptions. I don't mind unexpected exceptions, but I would mind core dumps. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an

[Python-Dev] Re: Hygenic macros PEP.

2020-09-15 Thread Greg Ewing
r, and the one exposed to Python in the ast module. The only time the latter should need to change is if there is a change in the syntax of the language, so why not promise to keep it stable and use it as the form taken and produced by the macro processors

[Python-Dev] Re: Hygenic macros PEP.

2020-09-15 Thread Greg Ewing
syntax so that users can keep it in their heads. Maybe the PEP should propose an AST of its own, which would initially be a third thing separate from either of the existing ones, with the possibility of adopting it as the ast module representation some time in the future. -- Greg

[Python-Dev] Re: Hygenic macros PEP.

2020-09-15 Thread Greg Ewing
themselves. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/

[Python-Dev] Re: Tagged pointer experiment: need help to optimize

2020-09-22 Thread Greg Ewing
array, numpy, etc. -- and you only pay for the overhead of those if you need them. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.pytho

[Python-Dev] Re: Understanding why object defines rich comparison methods

2020-09-22 Thread Greg Ewing
tp_compare, which also handled all the comparisons, so tp_richcompare was likely seen as a generalisation of that. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.

[Python-Dev] Re: Changing Python's string search algorithms

2020-10-14 Thread Greg Ewing
On 15/10/20 1:45 pm, Chris Angelico wrote: So it'd be heuristics in the core language that choose a good default for most situations, and then a str method that returns a preprocessed needle. Or maybe cache the results of the preprocessing? --

[Python-Dev] yield * (Re: Missing operator.call)

2009-02-07 Thread Greg Ewing
the moment, then def f(): v = yield *g() print v def g(): yield 42 return "spam" for x in f(): pass should end up printing "spam". Would you entertain the idea of a "yield *" expression with those semantics? -- Greg ___

Re: [Python-Dev] yield * (Re: Missing operator.call)

2009-02-07 Thread Greg Ewing
s as coroutines. -- Greg ___ 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] yield * (Re: Missing operator.call)

2009-02-07 Thread Greg Ewing
be any conflict. But if you think there will be a conflict, or that the similarity would be too confusing, maybe the new construct should be called something else. I'm open to suggestions. -- Greg ___ Python-Dev mailing list Python-Dev@python.org

<    2   3   4   5   6   7   8   9   10   11   >