[Python-Dev] Re: PEP 505 (None-aware operators) for Python 3.11

2021-10-18 Thread Guido van Rossum
of Python users, but not of Python core devs). I worry that the experienced folks may perhaps be a little too eager to protect newbies from shooting themselves in the foot. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/

[Python-Dev] Re: PEP 505 (None-aware operators) for Python 3.11

2021-10-18 Thread Guido van Rossum
's the kind of data you're given and that's the kind of app you have to write, and you can't control the format of the data. Using ?. this can be written as y = config?.get("handler")?.get("parameters")?.get("y") More examples are in PEP 505 itself, see https://www.pyt

[Python-Dev] Re: Documenting Python versioning and stability expectations

2021-10-16 Thread Guido van Rossum
Wasn't there a change in a micro version of Python 2? I can't remember > the details, but from hindsight it was seen as a mistake that should not > be repeated. > That was in the olden days. In particular, bool() and True/False were introduced in Python 2.2.1 ( https://docs.python.org/2.7/library/f

[Python-Dev] Re: RFC on Callable Type Syntax

2021-10-15 Thread Guido van Rossum
). + Address edge cases like trailing commas, `Concatenate` for `ParamSpec`, > and runtime value of the expression. > + Explicitly discuss the function-name-as-a-type proposal. > > We will be drafting the PEP over the coming month. > Awesome. You have my blessing. -- --Guido van Rossu

[Python-Dev] Re: PEP 505 (None-aware operators) for Python 3.11

2021-10-14 Thread Guido van Rossum
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.org/message/XZZIV42XGG3EIHRBBCCTTCFPWWSOT7MX/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van

[Python-Dev] Re: What is __int__ still useful for?

2021-10-13 Thread Guido van Rossum
is a string should also work, so int() can't call __trunc__ (as was explained earlier in the thread). -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun

[Python-Dev] Re: RFC on Callable Type Syntax

2021-10-11 Thread Guido van Rossum
On Mon, Oct 11, 2021 at 3:22 PM Erik Demaine wrote: > On Mon, 11 Oct 2021, Guido van Rossum wrote: > No, I didn't write that, Lukasz did. > I always found the following more obvious: > > > > def data_to_table(d: Iterable[Mapping[str, float]], *, sort: bool = > False

[Python-Dev] Re: RFC on Callable Type Syntax

2021-10-11 Thread Guido van Rossum
def Comparison(a: T, b: T) -> Literal[-1, 0, 1]: ... my first thought is that it's a comparison function that someone hasn't finished writing yet, not a function type -- since if it did have at least one line of code in the body, it *would* be that. -- --Guido van Rossum (python.org/~gui

[Python-Dev] Re: Why doesn't peephole optimise away operations with fast locals?

2021-10-10 Thread Guido van Rossum
ev@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.org/message/73BMYW3TY7PJB7KRQ3Q3OROGU5UJVJAW/ > Code of Conduct:

[Python-Dev] Re: Why doesn't peephole optimise away operations with fast locals?

2021-10-10 Thread Guido van Rossum
On Sun, Oct 10, 2021 at 12:27 PM Patrick Reader <_...@pxeger.com> wrote: > On 10/10/2021 18:33, Guido van Rossum wrote: > > On Sun, Oct 10, 2021 at 10:28 AM Brandt Bucher > wrote: > >> the peephole optimizer shouldn’t be tasked with “fixing” poorly-written >>

[Python-Dev] Re: Why doesn't peephole optimise away operations with fast locals?

2021-10-10 Thread Guido van Rossum
mizer can prove that it can't raise a name error.) -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> ___ Python-D

[Python-Dev] Re: Why doesn't peephole optimise away operations with fast locals?

2021-10-10 Thread Guido van Rossum
iling 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.org/message/767FGRV4ZL5IVBHWSAW5TJGQMGQS244Z/ &g

[Python-Dev] Re: Packing a long list of numbers into memory

2021-10-10 Thread Guido van Rossum
Maybe instead of tobytes() you can use memoryview(). On Sun, Oct 10, 2021 at 08:21 Facundo Batista wrote: > El dom, 10 de oct. de 2021 a la(s) 11:50, Serhiy Storchaka > (storch...@gmail.com) escribió: > > > > 10.10.21 17:19, Facundo Batista пише: > > > I have a long list of nums (several

[Python-Dev] Re: Python multithreading without the GIL

2021-10-08 Thread Guido van Rossum
hon/cpython/pull/28488 -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> ___ Python-Dev mailing list -- python-d

[Python-Dev] Re: RFC on Callable Type Syntax

2021-10-08 Thread Guido van Rossum
ething introspectable is the same.) Union objects have an `__args__` attribute that gives the underlying types, and a `__parameters__` attribute giving any type variables. Note that the implementation of this introspectable type should ultimately be in C. -- --Guido van Rossum (python.org/~guido) *Pronou

[Python-Dev] Re: RFC on Callable Type Syntax

2021-10-08 Thread Guido van Rossum
lace Callable in > the initial PEP (option 1) or to specify a more complete syntax from the > beginning (option 2). > > 5. Serhiy Storchaka > > > How could you replace Callable[..., int] and Callable[Concatenate[str, > P], int] ? > > To represent a Callable that accepts arbitr

[Python-Dev] Re: RFC on Callable Type Syntax

2021-10-08 Thread Guido van Rossum
return x+1" and you can't write "f 42". Allowing the omission of the parentheses here would be inconsistent (even if some other languages allow it). -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://femi

[Python-Dev] Re: Python multithreading without the GIL

2021-10-08 Thread Guido van Rossum
To be clear, Sam’s basic approach is a bit slower for single-threaded code, and he admits that. But to sweeten the pot he has also applied a bunch of unrelated speedups that make it faster in general, so that overall it’s always a win. But presumably we could upstream the latter easily, separately

[Python-Dev] Re: PEP 654 except* formatting

2021-10-06 Thread Guido van Rossum
some + expression group as e: … Argh. This would be very easy to overlook. As the senior author of PEP 654 I am going to go with "except*". Since it was shown that "except group" has ambiguous edge cases the proposals have gotten worse, which to me is a good sign that we

[Python-Dev] Re: PEP 654 except* formatting

2021-10-04 Thread Guido van Rossum
The question was about which style to *recommend* (a la PEP-8). On Mon, Oct 4, 2021 at 8:03 AM Jonathan Goble wrote: > On Mon, Oct 4, 2021 at 1:24 AM Guido van Rossum wrote: > >> On Sun, Oct 3, 2021 at 9:20 PM Jonathan Goble wrote: >> >>> Therefore my vote

[Python-Dev] Re: PEP 654 except* formatting

2021-10-03 Thread Guido van Rossum
On Sun, Oct 3, 2021 at 9:20 PM Jonathan Goble wrote: > Therefore my vote is for requiring `except* E` and keeping `except *E` as > a SyntaxError. > You can't do that with our current lexer+parser. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here

[Python-Dev] Re: PEP 654 except* formatting

2021-10-03 Thread Guido van Rossum
be bikeshedding the syntax. This thread was meant to solicit feedback on how to *format* it: does the space go before or after the '*'. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-

[Python-Dev] Re: PEP 654 except* formatting

2021-10-03 Thread Guido van Rossum
We’ll, typically you don’t explicitly mention ExceptionGroup — it’s implied by the ‘except*’ syntax. Introducing match semantics probably wouldn’t open up new functionality, you can already write ‘except (E1, E2):’. On Sun, Oct 3, 2021 at 09:00 Thomas Grainger wrote: > What about `except case

[Python-Dev] Re: Worried about Python release schedule and lack of stable C-API

2021-09-28 Thread Guido van Rossum
What I have heard repeatedly, from people who are paid to know, is that most users don’t care about the latest features, and would rather stick to a release until it becomes unsupported. (Extreme example: Python 2.) Numpy isn’t random, it’s at the bottom of the food chain for a large ecosystem or

[Python-Dev] Re: The Default for python -X frozen_modules.

2021-09-27 Thread Guido van Rossum
-optimizations`, which doesn't mention PGO -- IIUC it turns on PGO and LTO, if they're available. So my *actual* proposal (call it #2') is to use a separate compile-time flag, which is set by `./configure --enable-optimizations` regardless of whether PGO/LTO are possible, and which on Window

[Python-Dev] Re: Changing exception text in micro releases

2021-09-24 Thread Guido van Rossum
In this case I am inclined not to backport. In general we should look at existing usage before making changes. Somebody’s code might break — but does it matter? That depends on a lot of factors. E.g. if parsing an error message has become a common way to get useful info out of the error that is

[Python-Dev] Re: f-strings in the grammar

2021-09-21 Thread Guido van Rossum
t the time because we were coming from "{xxx}".format(...), where the parser doesn't know that the string is a format string. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singul

[Python-Dev] Re: f-strings in the grammar

2021-09-21 Thread Guido van Rossum
.py")}.c: $(srcdir)/{source}") print("\t$(COMMAND)") So these two tools, at least, seem to be doing all right (maybe because they both come from the JavaScript culture, where nested interpolations are well-known). -- --Guido van Rossum

[Python-Dev] Re: f-strings in the grammar

2021-09-20 Thread Guido van Rossum
ot;.py")}.c: $(srcdir)/{source}") ^ SyntaxError: f-string: unmatched '(' ``` -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-

[Python-Dev] Re: f-strings in the grammar

2021-09-20 Thread Guido van Rossum
On Mon, Sep 20, 2021 at 1:07 PM Patrick Reader <_...@pxeger.com> wrote: > > The current restrictions will also confuse some users (e.g. those used > to bash, and IIRC JS, where the rules are similar as what Pablo is > proposing). > > -- > > --Guido van Rossum (python

[Python-Dev] Re: f-strings in the grammar

2021-09-20 Thread Guido van Rossum
> https://mail.python.org/archives/list/python-dev@python.org/message/TWSJKE4KKSW7YD3OCHKGKJC52VUG6FY5/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/

[Python-Dev] Re: Should the definition of an "(async) iterator" include __iter__?

2021-09-15 Thread Guido van Rossum
this works: for x in S(): ... However this doesn't: for x in iter(S()): ... In Steven's view, A does not deserve to work in the former case: Because A is a "broken" iterator, he seems to want it rejected by the iter() call that is *implicit* in the for-loop. Reminder about how for-loops work:

[Python-Dev] Re: python3.10rc2 compilation on android/termux/clang12.0.1 fails

2021-09-15 Thread Guido van Rossum
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.org/message/KEURSMCLUVI7VPKM6M2VUV4JIW6FP66Z/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guid

[Python-Dev] Re: Should the definition of an "(async) iterator" include __iter__?

2021-09-15 Thread Guido van Rossum
On Tue, Sep 14, 2021 at 11:44 PM Steven D'Aprano wrote: > On Tue, Sep 14, 2021 at 09:38:38PM -0700, Guido van Rossum wrote: > > > > I don't know what I would call an object that only has __next__, > > > apart from "broken" :-( > > > > > > &

[Python-Dev] Re: Should the definition of an "(async) iterator" include __iter__?

2021-09-14 Thread Guido van Rossum
__next__, > apart from "broken" :-( > It's still an iterator, since it duck-types in most cases where an iterator is required (notably "for", which is the primary use case for the iteration protocols -- it's in the first sentence of PEP 234's abstract). -- -

[Python-Dev] Re: Should the definition of an "(async) iterator" include __iter__?

2021-09-14 Thread Guido van Rossum
On Tue, Sep 14, 2021 at 9:03 PM Steven D'Aprano wrote: > On Tue, Sep 14, 2021 at 12:33:32PM -0700, Guido van Rossum wrote: > > My view of this is: > > > > A. It's not an iterator if it doesn't define `__next__`. > > > > B. It is strongly recommended tha

[Python-Dev] Re: Should the definition of an "(async) iterator" include __iter__?

2021-09-14 Thread Guido van Rossum
On Tue, Sep 14, 2021 at 4:33 PM Brandt Bucher wrote: > Guido van Rossum wrote: > > On Tue, Sep 14, 2021 at 3:49 PM Brandt Bucher brandtbuc...@gmail.com > > wrote: > > > I think it's also worth noting that a missing "`__iter__` that returns > > > self" i

[Python-Dev] Re: Should the definition of an "(async) iterator" include __iter__?

2021-09-14 Thread Guido van Rossum
er things that don't follow the letter of the protocol, just to get things going. (This is common for complex protocols like Mapping, where some function you have no control over insists on a Mapping but only calls one or two common methods. Duck typing is alive and kicking! -- --Guido van Rossu

[Python-Dev] Re: Should the definition of an "(async) iterator" include __iter__?

2021-09-14 Thread Guido van Rossum
https://mail.python.org/mailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/3W7TDX5KNVQVGT5CUHBK33M7VNTP25DZ/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van

[Python-Dev] Re: Making code object APIs unstable

2021-09-07 Thread Guido van Rossum
On Tue, Sep 7, 2021 at 10:00 AM Stefan Behnel wrote: > Guido van Rossum schrieb am 07.09.21 um 00:44: > > In addition, I just heard from the SC that they've approved the > exception. > > So we will remove these two APIs from 3.11 without deprecation. > > Erm, hang on

[Python-Dev] Re: Making code object APIs unstable

2021-09-06 Thread Guido van Rossum
On Fri, Sep 3, 2021 at 4:12 PM Victor Stinner wrote: > On Thu, Sep 2, 2021 at 11:15 PM Guido van Rossum wrote: > > FWIW I've applied for an exception from the two-release deprecation > policy from the SC: > > https://github.com/python/steering-council/issues/75 > > On th

[Python-Dev] Re: A better way to freeze modules

2021-09-02 Thread Guido van Rossum
Quick reaction: This feels like a bait and switch to me. Also, there are many advantages to using a standard format like zip (many formats are really zip with some conventions). Finally, the bytecode format you are using is “marshal”, and is fully portable — as is zip. On Thu, Sep 2, 2021 at

[Python-Dev] Re: Discrepancy between what aiter() and `async for` requires on purpose?

2021-09-02 Thread Guido van Rossum
s the __[a]iter__ method call feels more > legitimate in the actual for loop syntax, it just feels odd to me if the > builtin isn't forcing the call. > > Cheers, > Nick. > >> > > > >> > ___ > Python-Dev mail

[Python-Dev] Re: Making code object APIs unstable

2021-09-02 Thread Guido van Rossum
ssage/TDLCJHNQSPNE7UXEJ33PV2VNQOPUFUT7/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/&

[Python-Dev] Re: Making code object APIs unstable

2021-09-01 Thread Guido van Rossum
for these two functions. That means: - Get rid of PyCode_NewWithPosArgs altogether - PyCode_New becomes unstable (and gets a new posinlyargcount argument) On Wed, Sep 1, 2021 at 11:52 AM Guido van Rossum wrote: > (context) > >> Guido van Rossum schrieb am 13.08.21 um 19:24: >&g

[Python-Dev] Re: Making code object APIs unstable

2021-09-01 Thread Guido van Rossum
(context) > Guido van Rossum schrieb am 13.08.21 um 19:24: > > In 3.11 we're changing a lot of details about code objects. Part of this > is > > the "Faster CPython" work, part of it is other things (e.g. PEP 657 -- > Fine > > Grained Error Locations in Trac

[Python-Dev] Re: PEP 667: Consistent views of namespaces

2021-08-26 Thread Guido van Rossum
weird interactions if a trace hook is > enabled during the initial start up of the interpreter and tries to trace > the proxy implementation code. > Of course. But it would still be interesting to have pseudo-code in your PEP showing the semantics you intend to implement -- that way we can c

[Python-Dev] Re: PEP 667: Consistent views of namespaces

2021-08-26 Thread Guido van Rossum
cost of the extra indirection is irrelevant, this is always going to be a slow interface meant for occasional use in a debugger. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-th

[Python-Dev] Re: PEP 667: Consistent views of namespaces

2021-08-26 Thread Guido van Rossum
would be the use case for that? I guess to start over with a computation. But there are better ways to do that. So let's not worry too much about preventing the user from shooting themselves in the foot -- surely at the global level, "globals().clear()" will do weird shit too. :-) -- --Guid

[Python-Dev] Re: PEP 667: Consistent views of namespaces

2021-08-26 Thread Guido van Rossum
On Thu, Aug 26, 2021 at 1:29 AM Nick Coghlan wrote: > On Mon, 23 Aug 2021 at 13:07, Guido van Rossum wrote: > > But... I also care about backwards compatibility, and I have a crazy > idea for making PyEval_GetLocals() work in a useful manner without > compromising the behavior

[Python-Dev] Re: Should PEP 8 be updated for Python 3 only?

2021-08-24 Thread Guido van Rossum
l.python.org/mailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/MK7N36L3XCXVY5R4DIIYIDU2W7EGJKZ3/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: h

[Python-Dev] Re: PEP 667: Consistent views of namespaces

2021-08-23 Thread Guido van Rossum
propose to fix the bug by not writing things back that way, instead writing back whenever a key in the proxy is set. The discussion is about subtler differences between the proposals. —Guido On Mon, Aug 23, 2021 at 22:19 Steven D'Aprano wrote: > On Sat, Aug 21, 2021 at 05:46:52PM -0700, Guido

[Python-Dev] Re: PEP 667: Consistent views of namespaces

2021-08-23 Thread Guido van Rossum
On Mon, Aug 23, 2021 at 8:46 AM Mark Shannon wrote: > Hi Guido, > > On 23/08/2021 3:53 pm, Guido van Rossum wrote: > > On Mon, Aug 23, 2021 at 4:38 AM Mark Shannon > <mailto:m...@hotpy.org>> wrote: > > > > Hi Nick, > > >

[Python-Dev] Re: PEP 667: Consistent views of namespaces

2021-08-23 Thread Guido van Rossum
. > None of this is clear (at least not to me) from PEP 558. > One problem with PEP 558 is that it's got too many words, and it's lacking a section that crisply describes the semantics of the proposed implementation. I've suggested to Nick that he add a section with pseudo-code for the impleme

[Python-Dev] Re: PEP 667: Consistent views of namespaces

2021-08-22 Thread Guido van Rossum
On Sat, Aug 21, 2021 at 8:52 PM Nick Coghlan wrote: > > On Sun, 22 Aug 2021, 10:47 am Guido van Rossum, wrote: > >> >> Everything here is about locals() and f_locals in *function scope*. (I >> use f_locals to refer to the f_locals field of frame objects

[Python-Dev] Re: PEP 467 feedback from the Steering Council

2021-08-22 Thread Guido van Rossum
Hm, I don’t think the major use for bchr() will be with a constant. On Sun, Aug 22, 2021 at 14:48 Gregory P. Smith wrote: > > On Tue, Aug 10, 2021 at 3:48 PM Christopher Barker > wrote: > >> On Tue, Aug 10, 2021 at 3:00 PM wrote: >> >>> The history of bytes/bytearray is a dual-purpose view.

[Python-Dev] Re: PEP 667: Consistent views of namespaces

2021-08-21 Thread Guido van Rossum
n3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/4RH5YCXIHIP6MRVTCOKOOO4GKCIMH4GJ/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pro

[Python-Dev] Re: Making code object APIs unstable

2021-08-17 Thread Guido van Rossum
en we change internal APIs that things >> depend on, the more people will move their projects towards doing the right >> thing with regards to either not using said APIs or rerunning an up to date >> code generator as part of their build instead of checking in generated >> unsta

[Python-Dev] Re: Making code object APIs unstable

2021-08-16 Thread Guido van Rossum
an idea now: the C equivalent to .replace() could use the same input structure; one can leave fields NULL that should be copied from the original unmodified. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <h

[Python-Dev] Re: Making code object APIs unstable

2021-08-16 Thread Guido van Rossum
On Mon, Aug 16, 2021 at 9:30 AM Steve Dower wrote: > On 8/16/2021 12:47 AM, Guido van Rossum wrote: > > My current proposal is to issue a DeprecationWarning in PyCode_New() and > > PyCode_NewWithPosArgs(), which can be turned into an error using a > > command-line flag. If i

[Python-Dev] Re: Making code object APIs unstable

2021-08-15 Thread Guido van Rossum
On Sat, Aug 14, 2021 at 4:56 AM Serhiy Storchaka wrote: > 13.08.21 20:24, Guido van Rossum пише: > > If these weren't part of the stable ABI, I'd choose (E). But because > > they are, I think only (A) or (B) are our options. The problem with (C) > > is that if there's co

[Python-Dev] Re: Making code object APIs unstable

2021-08-13 Thread Guido van Rossum
On Fri, Aug 13, 2021 at 11:17 AM Terry Reedy wrote: > On 8/13/2021 1:24 PM, Guido van Rossum wrote: > [...] > > Unfortunately, PyCode_New() and PyCode_NewWithPosArgs() are part of the > > PEP 387 stable ABI. What should we do? > > PEP 387 is Backwards Comp

[Python-Dev] Making code object APIs unstable

2021-08-13 Thread Guido van Rossum
especially interested in Petr's opinion given that this is a case where we'd like to deprecate something in the stable ABI. See also discussion in https://bugs.python.org/issue40222 (esp. near the end). -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun her

[Python-Dev] Re: PEP 649: Deferred Evaluation Of Annotations

2021-08-12 Thread Guido van Rossum
I will try to find time to review the code. On Thu, Aug 12, 2021 at 08:56 Larry Hastings wrote: > > On 8/12/21 8:25 AM, Guido van Rossum wrote: > > Maybe we could specialize the heck out of this and not bother with a > function object? In the end we want to execute the cod

[Python-Dev] Re: PEP 649: Deferred Evaluation Of Annotations

2021-08-12 Thread Guido van Rossum
nction objects for annotation too. > > Function objects are heavier than code objects. And they are GC-tracked > objects. > > I want to know how we can reduce the function objects created for > annotation in PEP 649, before deprecating PEP 563. > > -- > Inada Naoki >

[Python-Dev] Re: PEP 649: Deferred Evaluation Of Annotations

2021-08-11 Thread Guido van Rossum
Oh, I agree it shouldn’t reference the typing module. But it should not raise NameError. This whole thing already is a special case. We can debate what else it should, e.g. skip the name, return a fixed error token, return an error token that includes the name that failed (this is part if the

[Python-Dev] Re: PEP 649: Deferred Evaluation Of Annotations

2021-08-11 Thread Guido van Rossum
As it happens, I have a working prototype of lazy in marshaling that would work well for this. On Wed, Aug 11, 2021 at 06:07 Larry Hastings wrote: > On 8/11/21 5:21 AM, Inada Naoki wrote: > > But memory footprint and GC time is still an issue. > Annotations in PEP 649 semantics can be much

[Python-Dev] Re: PEP 649: Deferred Evaluation Of Annotations

2021-08-10 Thread Guido van Rossum
gt;> > I implemented a version of this in > https://github.com/larryhastings/co_annotations/pull/3 but Larry didn't > like it. > However, I do like it, despite all Larry's arguing against it. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)*

[Python-Dev] Re: Repealing PEP 509 (Add a private version to dict)

2021-07-29 Thread Guido van Rossum
Maybe you should also mention that in 3.11 we’re introducing a new concept, dict *keys* version, which is more useful (for the specializing interpreter anyway). On Thu, Jul 29, 2021 at 12:47 Mark Shannon wrote: > Hi everyone, > > I would like to repeal PEP 509. We don't really have a process

[Python-Dev] Re: types.Union or types.UnionType?

2021-07-25 Thread Guido van Rossum
thon.org > https://mail.python.org/mailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/3O6STJNH6NCNWEBOGV3OB3DC6M2K47RN/ > Code of Conduct: http://python.org/psf/codeofconduct/ > --

[Python-Dev] Re: PEP 558: Defined semantics for locals()

2021-07-21 Thread Guido van Rossum
python.org > https://mail.python.org/mailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/QLPJWPVNDZ3ODMS275VDW4M2UW6PUW5N/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -

[Python-Dev] Re: PEP 558: Defined semantics for locals()

2021-07-20 Thread Guido van Rossum
arKind()`. (The API for this is very much in flux -- we'll settle by 3.11 beta 1 though. I expect we'll also have some Python-level public (but unstable) API to access these flags, so people can play around with this stuff.) -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my p

[Python-Dev] Re: Python3 OSF/1 support?

2021-07-14 Thread Guido van Rossum
ist -- 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.org/message/QQOYHF77AFRZZ3ZPYZDNIPBGC2AEE7HN/ > Code of

[Python-Dev] Re: Does anyone use threading debug PYTHONTHREADDEBUG=1 env var? Can I remove it?

2021-07-07 Thread Guido van Rossum
> 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/arch

[Python-Dev] Re: Is the Python review process flawed?

2021-07-01 Thread Guido van Rossum
Can we call this discussion closed? There’s not much more to be said. I’m not picking on you, Chris, I just think that not much will be gained by continuing the thread. I appreciate Esmeralda’s messages and all the responses. Now let’s go fix some bugs! :-) (Obligatory XKCD comic:

[Python-Dev] Re: Is the Python review process flawed?

2021-06-29 Thread Guido van Rossum
see why this is not so simple. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> ___ Python-Dev mailing list --

[Python-Dev] Re: cmd.Cmd.prompt should be an instance attribute

2021-06-26 Thread Guido van Rossum
Okay, then Chris Barker’s explanation applies. On Sat, Jun 26, 2021 at 16:35 Daniel Walker wrote: > I wasn't looking at the type stub but cmd.py itself. It has > > PROMPT = '(Cmd) ' > ... > > class Cmd: > prompt = PROMPT > ... > > On Sat, Jun 26, 2021 at 6

[Python-Dev] Re: cmd.Cmd.prompt should be an instance attribute

2021-06-26 Thread Guido van Rossum
md: prompt: str identchars: str ruler: str ... those are all instance attribute declarations. I think that you're running into a different mypy bug, which is that you can't override a plain attribute with a property in a subclass. I think there's already a bug for that in the

[Python-Dev] Re: Delayed evaluation of f-strings?

2021-06-24 Thread Guido van Rossum
()? It seems doable (at least for keyword args -- for positional args I don't think it makes sense). Honestly, the rest of the discussion belongs on python-ideas. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-the

[Python-Dev] Re: IntEnum, IntFlag, and the stdlib

2021-06-23 Thread Guido van Rossum
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.org/message/HE36QRXPPQNHGQKYZM3ZTG42EQQRHAIX/ >> Code of Conduct: http://python.org/psf/codeofconduc

[Python-Dev] Re: Making PY_SSIZE_T_CLEAN not mandatory.

2021-06-21 Thread Guido van Rossum
ste-carvello.net> wrote: > Hi, > > Le 18/06/2021 à 21:00, Guido van Rossum a écrit : > > Can you elaborate on that use case? Which two applications are you > > thinking of, and what was your goal in driving them? This sounds > > interesting but I haven’t encountered th

[Python-Dev] Re: Making PY_SSIZE_T_CLEAN not mandatory.

2021-06-18 Thread Guido van Rossum
Can you elaborate on that use case? Which two applications are you thinking of, and what was your goal in driving them? This sounds interesting but I haven’t encountered this myself. On Fri, Jun 18, 2021 at 09:44 Baptiste Carvello < devel2...@baptiste-carvello.net> wrote: > Le 18/06/2021 à

[Python-Dev] Re: Making PY_SSIZE_T_CLEAN not mandatory.

2021-06-17 Thread Guido van Rossum
I don’t see how the stable ABI works as a substitute for vendoring Python. A lot of other things can still vary even when the C API remains the same! (E.g. syntax, and stdlib behavior.) On Thu, Jun 17, 2021 at 11:49 Steve Dower wrote: > On 6/9/2021 2:20 PM, Petr Viktorin wrote: > > On 09. 06.

[Python-Dev] Re: Proposal: declare "unstable APIs"

2021-06-05 Thread Guido van Rossum
building mindshare for limiting API use to the stable API. Thanks Petr for pushing this! -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>

[Python-Dev] Re: Proposal: declare "unstable APIs"

2021-06-05 Thread Guido van Rossum
On Fri, Jun 4, 2021 at 6:15 AM Victor Stinner wrote: > On Fri, Jun 4, 2021 at 12:29 AM Guido van Rossum wrote: > >> In the C API, there is the internal C API which fits with your > >> description. To access it, you have to declare the > >> Py_BUILD_CORE_MODULE m

[Python-Dev] Re: Proposal: declare "unstable APIs"

2021-06-03 Thread Guido van Rossum
ntinue to exist for many versions, but their output can > change? In one sense, dis.dis() always does the exact same thing: it > shows you the disassembly of a piece of code. In another sense, its > output changes drastically when things change. > That's debatable. I sure hope peopl

[Python-Dev] Re: Proposal: declare "unstable APIs"

2021-06-03 Thread Guido van Rossum
be "dead API", what is a dead API exactly? And doesn't it follow that all APIs are living? If we stick with unstable, we're adopting a term that's in use by at least one other language community (Rust), and the slightly negative connotation is welcome -- people should think twice before using

[Python-Dev] Re: Proposal: declare "unstable APIs"

2021-06-03 Thread Guido van Rossum
odules of a package are > called "_something.py" and they exposed in package/__init__.py (or > another public module). > I was primarily thinking of the docs. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?

[Python-Dev] Re: Proposal: declare "unstable APIs"

2021-06-03 Thread Guido van Rossum
On Thu, Jun 3, 2021 at 11:11 Gregory P. Smith wrote: > One obvious now in hindsight question: Why are any of these APIs even > public? They all deserve underscore prefixed names to highlight their > private-ness and potential instability. > Because they are still useful when manipulating or

[Python-Dev] Re: Proposal: declare "unstable APIs"

2021-06-03 Thread Guido van Rossum
3, 2021 at 10:32 AM Senthil Kumaran wrote: > On Thu, Jun 03, 2021 at 10:10:53AM -0700, Guido van Rossum wrote: > > This is not a complete thought yet, but it occurred to me that while we > have > > deprecated APIs (which will eventually go away), and provisional APIs > (whic

[Python-Dev] Proposal: declare "unstable APIs"

2021-06-03 Thread Guido van Rossum
maybe the docs should grow a standard way of saying "this is an unstable API"? Would we need a PEP to create an initial list of APIs (modules, classes, etc.) that are considered unstable? -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun her

[Python-Dev] Re: change of behaviour for '.' in sys.path between 3.10.0a7 and 3.10.0b1

2021-06-03 Thread Guido van Rossum
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.org/message/CW2SAOGIO5EIXU7GJZIN26MLF6AC2HD5/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- -

[Python-Dev] Origins of iterators and iterables

2021-05-30 Thread Guido van Rossum
here was an intermediate step (I vaguely recall a special dunder?), but eventually we realized that the best way to write this was just for line in f: (the iterator can buffer internally) and we accepted that you can only iterate once over a file -- we just told people "if you double-iterate ov

[Python-Dev] Re: python-iterators mailing list on SourceForge

2021-05-30 Thread Guido van Rossum
What are you trying to get from the archives? It is *possible* that I have a personal archive saved somewhere. On Sun, May 30, 2021 at 02:39 Julien Palard wrote: > Le 5/29/21 à 11:14 PM, Guido van Rossum a écrit : > > It looks like what's left of the archives is largely spam

[Python-Dev] Re: python-iterators mailing list on SourceForge

2021-05-29 Thread Guido van Rossum
ailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/ZF64Y53M3KEKAGROORJA6SD6GPX2HDJO/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why

[Python-Dev] Re: IRC #python-dev channel is now on Libera Chat (bye bye Freenode)

2021-05-26 Thread Guido van Rossum
d change the topic > (as happened with #python-fr). > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> ___ Python-

[Python-Dev] Re: IRC #python-dev channel is now on Libera Chat (bye bye Freenode)

2021-05-26 Thread Guido van Rossum
___ > 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.org/messa

[Python-Dev] Re: GDB not breaking at the right place

2021-05-25 Thread Guido van Rossum
On Tue, May 25, 2021 at 7:42 PM Inada Naoki wrote: > On Tue, May 25, 2021 at 5:38 AM Guido van Rossum wrote: > > > > To the contrary, I think if you want the CI jobs to be faster you should > add the CFLAGS to the configure call used to run the CI jobs. > > > > -

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-25 Thread Guido van Rossum
On Tue, May 25, 2021 at 7:56 PM Brett Cannon wrote: > > On Tue., May 25, 2021, 12:58 Guido van Rossum, wrote: > >> [...] >> Or do you think the "Standards Track" PEP should just codify general >> agreement that we're going to implement a specializing ad

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-25 Thread Guido van Rossum
On Tue, May 25, 2021 at 1:50 PM Łukasz Langa wrote: > > On 25 May 2021, at 21:57, Guido van Rossum wrote: > > On Tue, May 25, 2021 at 12:34 PM Brett Cannon wrote: > >> >> I personally think it should be a Standards Track PEP. This PEP isn't >> documentin

  1   2   3   4   5   6   7   8   9   10   >