[Python-Dev] Plan to accept PEP 544, PEP 586, PEP 589, PEP 591 -- last call for discussion

2019-05-20 Thread Guido van Rossum
Please send all discussions about these PEPs to the typing-sig mailing list, so we have the archives all in one place. Read the full message here: https://mail.python.org/archives/list/typing-...@python.org/thread/GCI2TF43SESP2XVSETWOW33SRRWQTHM4/ -- --Guido van Rossum (python.org/~guido

Re: [Python-Dev] Parser module in the stdlib

2019-05-20 Thread Guido van Rossum
good reason to tie deletion (or deprecation) of the `parser` module to whatever we do there. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him/his **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> ___

Re: [Python-Dev] Parser module in the stdlib

2019-05-20 Thread Guido van Rossum
ze.py is closely tied to the names and numbers of the tokens, and the latter information is currently generated based on the contents of the Grammar file. This may get in the way of using it to tokenize old Python versions. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him/his **(w

Re: [Python-Dev] Parser module in the stdlib

2019-05-20 Thread Guido van Rossum
On Mon, May 20, 2019 at 11:29 AM Steven D'Aprano wrote: > On Mon, May 20, 2019 at 08:55:59AM -0700, Guido van Rossum wrote: > > > I am interested in switching CPython's parsing strategy to something else > > (what exactly remains to be seen) > > Are you r

Re: [Python-Dev] bpo-36919: Exception from 'compile' reports a newline char not present in input

2019-05-20 Thread Guido van Rossum
o make them > implementation independent. > > Thanks for comments, > Pavel > > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/ma

Re: [Python-Dev] PEP 594: Removing dead batteries from the standard library

2019-05-20 Thread Guido van Rossum
decompression to argparse if fileinput > is deprecated. > > Regards, > > -- > Inada Naoki > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: >

Re: [Python-Dev] PEP 594: Removing dead batteries from the standard library

2019-05-21 Thread Guido van Rossum
; > for the fjords. Discussions like this need a bit of levity to keep us > all grounded, IMO. > > Paul > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Un

Re: [Python-Dev] PEP 594: Removing dead batteries from the standard library

2019-05-21 Thread Guido van Rossum
e documentation, if we want to endorse them. But just as > we're not removing `array` in favor of `numpy`, we shouldn't remove > colorsys either. Colorsys is not dead, it's just small. > > I assume one of the reasons colorspacio

Re: [Python-Dev] PEP 594: update 1

2019-05-21 Thread Guido van Rossum
OK, sounds like nntplib can stay — this time. On Tue, May 21, 2019 at 08:33 Antoine Pitrou wrote: > > As I said, if the main annoyance with nntplib is the sporadic test > failures, then the relevant tests can be disabled on CI. > > NNTP itself is still used, even if less and less. > > Regards >

Re: [Python-Dev] PEP 594: Removing dead batteries from the standard library

2019-05-21 Thread Guido van Rossum
ython.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/guido%40python.org > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him/his **(why is my pronoun here?)* <http://feministing.com/2015/02/03

Re: [Python-Dev] PEP 594: Removing dead batteries from the standard library

2019-05-21 Thread Guido van Rossum
odule still has fans. Threatening to open a CVE is more likely to reduce support for the PEP than it is to convince anyone. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him/his **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-

Re: [Python-Dev] PEP 544 and dunder methods

2019-05-21 Thread Guido van Rossum
) > > -eric > > > [1] https://www.python.org/dev/peps/pep-0544/#implementation-details > _______ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org

Re: [Python-Dev] PEP 594: update 1

2019-05-21 Thread Guido van Rossum
oine. >> ___ >> Python-Dev mailing list >> Python-Dev@python.org >> https://mail.python.org/mailman/listinfo/python-dev >> Unsubscribe: >> https://mail.python.org/mailman/options/python-dev/brett%40python.org >&g

Re: [Python-Dev] PEP 594: update 1

2019-05-22 Thread Guido van Rossum
/cpython/pull/9461 should fix most of the > annoyances with test_nntplib. It uses a local server instead of an > external one. > > --Berker > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman

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

2019-05-25 Thread Guido van Rossum
e_LocalsToFast``, > were > removed in the migration to Python 3: ``exec`` is no longer a statement > (and > hence can no longer affect function local namespaces), and the compiler > now > disallows the use of ``from module import *`` operations at function > scope > * however,

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

2019-05-25 Thread Guido van Rossum
functions), I don't think that what you describe here is too worrisome a scenario. On Sat, May 25, 2019 at 2:09 PM Nathaniel Smith wrote: > On Sat, May 25, 2019, 07:38 Guido van Rossum wrote: > >> This looks great. >> >> I only have two nits with the text. >>

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

2019-05-27 Thread Guido van Rossum
he new version, > otherwise you are just forcing the programmer to be making the copies > explicitly. > > -- > Richard Damon > > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/

Re: [Python-Dev] [PEP 558] thinking through locals() semantics

2019-05-27 Thread Guido van Rossum
ng it. > > > # Conclusion so far > > [PEP-minus-tracing] seems to strictly dominate [PEP]. It's equal or > better on all criteria, and actually *more* compatible with all the > legacy code I looked at, even though it's technically less consistent > with what CP

Re: [Python-Dev] [PEP 558] thinking through locals() semantics

2019-05-27 Thread Guido van Rossum
May 27, 2019 at 9:16 AM Guido van Rossum wrote: > > > > I re-ran your examples and found that some of them fail. > > > > On Mon, May 27, 2019 at 8:17 AM Nathaniel Smith wrote: > [...] > >> The interaction between f_locals and and locals() is also subtle: > &g

Re: [Python-Dev] [PEP 558] thinking through locals() semantics

2019-05-27 Thread Guido van Rossum
> > > Consistency across contexts: it's surprising if locals() has acts > > differently in module/class scope versus function scope. This argues > > for [proxy]. > > True as far as it goes, but its also true that for the longest time, in > mo

Re: [Python-Dev] Accepting PEP 590 (Vectorcall)

2019-05-28 Thread Guido van Rossum
he code of conduct.) I'd be happy to know how I can improve. > > > And now, I'm off to get the implementation reviewed! > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/pyt

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

2019-05-28 Thread Guido van Rossum
? (There used to be some relevant builtins that took dicts but not general MutableMappings -- but that has been fixed long ago.) -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him/his **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-usi

Re: [Python-Dev] [PEP 558] thinking through locals() semantics

2019-05-28 Thread Guido van Rossum
So why is it “hellish” for JITs if locals() returns a proxy, while frame.f_locals being a proxy is okay? On Tue, May 28, 2019 at 9:12 PM Nick Coghlan wrote: > (I'll likely write a more detailed reply once I'm back on an actual > computer, but wanted to send an initial response while folks in the

Re: [Python-Dev] [PEP 558] thinking through locals() semantics

2019-05-28 Thread Guido van Rossum
Indeed. On Tue, May 28, 2019 at 11:07 PM Greg Ewing wrote: > Nick Coghlan wrote: > > Having a single locals() call de-optimize an entire function would be > > far from ideal. > > I don't see what would be so bad about that. The vast majority > of functions have no need for locals(). > > -- > Gre

Re: [Python-Dev] Should I postpone PEP 558 (locals() semantics) to Python 3.9?

2019-05-30 Thread Guido van Rossum
-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/guido%40python.org > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him/his **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> ___

Re: [Python-Dev] [PEP 558] thinking through locals() semantics

2019-05-30 Thread Guido van Rossum
ight. And static analysis should also be able to detect most uses of locals() in a frame. I believe I've heard of some alternate Python implementations that detect usage of some functions to disable some optimizations (IIRC IronPython did this to sys._getframe()). -- --Guido van Rossum (python

[Python-Dev] Re: How to (best) organize platform dependent blocks of Python code

2019-06-17 Thread Guido van Rossum
w should we > do platform-specific conditions". > > Cheers, > Steve > _______ > Python-Dev mailing list -- python-dev@python.org > To unsubscribe send an email to python-dev-le...@python.org > https://mail.python.org/mailman3/

[Python-Dev] Annoying user on GitHub

2019-07-01 Thread Guido van Rossum
There's a user on GitHub ('experimentalles') who has created random PRs on several projects (e.g. https://github.com/python/peps/pull/1116). Can we ban them? The PRs look the work of a vandal or a bot, not of a clueless human. -- --Guido van Rossum (python.org/~guido) *Prono

[Python-Dev] Re: Removing dead bytecode vs reporting syntax errors

2019-07-08 Thread Guido van Rossum
ent without a separate pass to make sure you don't try to assign to a call, and it would allow a much more elegant approach to keyword arguments and the walrus operator.) --Guido van Rossum (python.org/~guido) *Pronouns: he/him/his **(why is my pronoun here?)* <http://feministing.com/2015/0

[Python-Dev] Re: Keyword arguments with non-string names

2019-07-09 Thread Guido van Rossum
n.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/JSAQAZD2GREBH72VCHO5ZZJQSYQHLTOV/ > -- --Guido van Rossum (python.o

[Python-Dev] Re: The order of operands in the comparison

2019-07-20 Thread Guido van Rossum
what this side should be. > ___ > 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: 🍝 New keyword in bpo: `newcomer friendly`

2019-07-26 Thread Guido van Rossum
"easy" aimed at somewhat different targets? > > Skip > > > Skip > ___ > Python-Dev mailing list -- python-dev@python.org > To unsubscribe send an email to python-dev-le...@python.org > https://mail.python.org/mailman3/

[Python-Dev] Re: 🍝 New keyword in bpo: `newcomer friendly`

2019-07-26 Thread Guido van Rossum
this was already discussed > in the initial thread, I don't have access to core-mentorship. > I don't know yet. You can watch updates to the devguide to find out. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him/his **(why is my pronoun here?)* <http://feministing.co

[Python-Dev] Re: 🍝 New keyword in bpo: `newcomer friendly`

2019-07-27 Thread Guido van Rossum
On Sat, Jul 27, 2019 at 8:46 PM Steve Dower wrote: > On 26Jul.2019 1909, Guido van Rossum wrote: > > See the thread 'The trouble with "Easy" issues' in > > core-mentors...@python.org <mailto:core-mentors...@python.org>. > > Essentially those "

[Python-Dev] Re: [core-workflow] Re: Re: 🍝 New keyword in bpo: `newcomer friendly`

2019-07-28 Thread Guido van Rossum
On Sun, Jul 28, 2019 at 1:25 PM Antoine Pitrou wrote: > On Fri, 26 Jul 2019 19:09:35 -0700 > Guido van Rossum wrote: > > See the thread 'The trouble with "Easy" issues' in > > core-mentors...@python.org. > > Essentially those "easy" issue

[Python-Dev] Re: typing: how to use names in result-tuples?

2019-07-29 Thread Guido van Rossum
hon-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/message/YGZELVWRGXZ5BTD4ZM

[Python-Dev] Re: typing: how to use names in result-tuples?

2019-07-30 Thread Guido van Rossum
ort lru_cache > >>> cached_namedtuple = lru_cache(None)(namedtuple) > >>> n1 = cached_namedtuple('f', ('a', 'b', 'c')) # A tuple rather than a > list of field names, as lists aren't hashable > >>> n2 = cached_namedtuple(&

[Python-Dev] Re: typing: how to use names in result-tuples?

2019-08-07 Thread Guido van Rossum
l? > > Things get also a bit more complicated since struct sequence > objects can contain unnamed fields. > > Any advice would be appreciated, I am no typing expert (yet :-) > > cheers -- Chris > > > On 30.07.19 17:10, Guido van Rossum wrote: > > I think I have to a

[Python-Dev] Re: PEP 638: Syntactic macros

2020-10-16 Thread Guido van Rossum
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/VEC7VWY5TJJGBXWFQUX3XO43SQAZ7FMR/ > Code of Conduct: http://python.org/psf/code

[Python-Dev] Pattern matching reborn: PEP 622 is dead, long live PEP 634, 635, 636

2020-10-22 Thread Guido van Rossum
x27;?' as a general assignment target. PEP 635 has some language against that idea. - Alternative indentation schemes. We decided to stick with the original proposal; see PEP 635. - Marking all capture variables with a sigil. We all agreed this was a bad idea; see PEP 635. -- --Guido van Ro

[Python-Dev] Re: Pattern matching reborn: PEP 622 is dead, long live PEP 634, 635, 636

2020-10-22 Thread Guido van Rossum
very tedious), so it's done during a later stage. We have many of these (e.g. 'return' outside function, also not encoded in the grammar). -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://

[Python-Dev] Re: Pattern matching reborn: PEP 622 is dead, long live PEP 634, 635, 636

2020-10-23 Thread Guido van Rossum
propose this as a follow-up for 3.11. But aren't Go channels more like asyncio Queues? I guess we'd need way more in terms of a worked-out example (using asyncio code, not Go code). -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://femini

[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-10-31 Thread Guido van Rossum
e in patterns. I could imagine seeing ``` match DEBUG_NETWORK, DEBUG_LOGIC: case False, False: pass case False, True: print("We're debugging logic only") case True, False: print("Debugging network only") case True, True: print("Debugging network and loggi

[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-10-31 Thread Guido van Rossum
On Sat, Oct 31, 2020 at 21:48 Dan Stromberg wrote: > > On Sat, Oct 31, 2020 at 9:37 PM Guido van Rossum wrote: > >> >> I think this over-stresses the notion that users might want to override >> the comparison operator to be used. We only have two operators that ma

[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-11-02 Thread Guido van Rossum
of two equal values" and we want to be able to call that out as an error. Hence the need for recognizing the wildcard in the parser, since `case x, _, _` *is* important. Hence the need to standardize it (i.e., not leave it to be *just* a convention). Using _ seems the most commonly used convention

[Python-Dev] Re: Who is target reader of tutorial?

2020-11-05 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

[Python-Dev] Re: Who is target reader of tutorial?

2020-11-06 Thread Guido van Rossum
rg > https://mail.python.org/mailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/E7Y5MB4JJEB3VW2J24HA7JQZH6JRAOMO/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (pyth

[Python-Dev] Re: Who is target reader of tutorial?

2020-11-06 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/AGYLMJQOWV6SQVBVT7VGEII77V4ALVT6/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum

[Python-Dev] Re: Who is target reader of tutorial?

2020-11-06 Thread Guido van Rossum
> Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/B54VI2DN2AYUXJG4SWSW2BMU5OOCIGSX/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <htt

[Python-Dev] Re: Please do not remove random bits of information from the tutorial

2020-11-09 Thread Guido van Rossum
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/message/2XKNMFRSK2YUDFDCQFX7XLIHUFQOLTAH/ >

[Python-Dev] Re: Please do not remove random bits of information from the tutorial

2020-11-09 Thread Guido van Rossum
Do you want to join the docs WG? IIUC it’s open to new members. (Carol?) On Mon, Nov 9, 2020 at 08:34 Chris Angelico wrote: > On Tue, Nov 10, 2020 at 3:19 AM Simon Cross > wrote: > > > > I really enjoyed learning from this "user manual with a strong > > narrative component" so I would personall

[Python-Dev] Re: Please do not remove random bits of information from the tutorial

2020-11-09 Thread Guido van Rossum
gt; > Raymond > ___ > 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 642 v2: Explicit constraint patterns *without* question marks in the syntax

2020-11-12 Thread Guido van Rossum
at > https://mail.python.org/archives/list/python-dev@python.org/message/RQPUV7PABLBNYJ7FI7QYCS6TKJ4H2Q2A/ > 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: Please do not remove random bits of information from the tutorial

2020-11-12 Thread Guido van Rossum
nd 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/LHGZNTRKU2Z2OD3W7DPFEDS274OBFE7F/ > Code of Conduct: http://python.org/psf/codeofconduct/ >

[Python-Dev] Re: PEP 642 v2: Explicit constraint patterns *without* question marks in the syntax

2020-11-12 Thread Guido van Rossum
will likely have a significant overlap with the current SC). I will wait for that. -- --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-t

[Python-Dev] Re: PEP 642 v2: Explicit constraint patterns *without* question marks in the syntax

2020-11-12 Thread Guido van Rossum
that they are pretty similar, since it will smooth learning (things don't have to be equal for learning by similarity to happen). This kind of syntactic "rhyme" is pretty important to me. Marking captures with sigils would destroy this. -- --Guido van Rossum (python.org/~gui

[Python-Dev] Re: PEP 642 v2: Explicit constraint patterns *without* question marks in the syntax

2020-11-14 Thread Guido van Rossum
But Point(x as a) already has a meaning in PEP 634; it’s a positional argument captured in x *and* in a. (Previously spelled as Point(a := x). The phrase ‘as a’ can be added after any pattern to *also* capture it in ‘a’. More typically used as e.g.‘Pattern(x, y) as p’, which captures the first two

[Python-Dev] Re: The semantics of pattern matching for Python

2020-11-16 Thread Guido van Rossum
ived at > https://mail.python.org/archives/list/python-dev@python.org/message/BTPODVYLPKY5IHWFKYQJICONTNTRNDB2/ > 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/0

[Python-Dev] Re: Why does "except Ex as x" not restore the previous value of x?

2020-11-17 Thread Guido van Rossum
v.python.org/ > > Message archived at > > > https://mail.python.org/archives/list/python-dev@python.org/message/KGYRLITEPB22ZZO4N7DD4A7QP7FQS6JO/ > > > > Code of Conduct: http://python.org/psf/codeofconduct/ > _

[Python-Dev] Re: Why does "except Ex as x" not restore the previous value of x?

2020-11-17 Thread Guido van Rossum
t; > ... > > >>> f(3) > > Traceback (most recent call last): > >File "", line 1, in > >File "", line 6, in f > > UnboundLocalError: local variable 'x' referenced before assignment > &

[Python-Dev] Re: Questions about about the DLS 2020

2020-11-18 Thread Guido van Rossum
here, too, it is a normal variable name except in patterns. PS. Why do you think that this is "late in Python's history?" In 100 years people will chuckle about that. :-) -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* &l

[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-11-18 Thread Guido van Rossum
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/YMLP5QDXRCO2QJG2GXJFIG3F4F56VLPL/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/

[Python-Dev] Re: Questions about about the DLS 2020

2020-11-20 Thread Guido van Rossum
But none of those limitations are there under our proposal. You can write this if you want: match = 1 match match: case case: print(case, match) And you can use _(“...”) anywhere in the case block and even in the guard. Just not as a pattern, but you can’t use f(1) there either... On Fri,

[Python-Dev] Re: Questions about about the DLS 2020

2020-11-20 Thread Guido van Rossum
that they get bonus points for being different. This is not a case of "feature envy" (often seen when people propose a feature that they like in another language without understanding Python). Pattern matching fills a real need and the design is about as Pythonic as it gets. -- --

[Python-Dev] Re: Words rather than sigils in Structural Pattern Matching

2020-11-21 Thread Guido van Rossum
that the meaning of a bare name should be a capture variable. -- --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: The semantics of pattern matching for Python

2020-11-21 Thread Guido van Rossum
in your writing style? We all will need to get along for a long time after this particular topic is put to rest, but each time I see one of your posts like this I find it harder to respond rationally rather than emotionally. (It is no accident that it took me 5 days to respond here.) -- --Guido va

[Python-Dev] Re: The semantics of pattern matching for Python

2020-11-22 Thread Guido van Rossum
s the only bug in Steven's example that I found, but I didn't bother to call it out.) (c) What Ethan said -- after fixing the syntax this does show that the keywords in class patterns correspond to attributes, not to constructor arguments (unless those are the same, as they often ar

[Python-Dev] Re: python.org doc portal question/bug

2020-12-03 Thread Guido van Rossum
n-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/7IUE5AJZNYZHEGL4VYOFUKUYUCU7APMI/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guid

[Python-Dev] Re: python.org doc portal question/bug

2020-12-03 Thread Guido van Rossum
It's funny, that link is on every page, but nobody ever sees it. :-) On Thu, Dec 3, 2020 at 3:35 PM Jonathan Goble wrote: > On Thu, Dec 3, 2020 at 6:16 PM Guido van Rossum wrote: > >> If you want to get the attention of the people who maintain the website, >> please lo

[Python-Dev] Re: Pattern Matching controversy: Don't read PEP 635, read DLS'20 paper instead

2020-12-04 Thread Guido van Rossum
I hope more of the regulars here jump on this bandwagon. It will be a great day when Paul posts one of his offensive posts and there is just deafening silence. Paul was in my (very short) kill file for years but I decided to give him another chance. And he blew it. There is a reason why he was ba

[Python-Dev] Re: TypedDict behavior

2020-12-07 Thread Guido van Rossum
-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/message/6NEXFZIEFGKACLP6BUTJVWJ4ARXU

[Python-Dev] Re: __future__ annotations loses closure scope

2020-12-08 Thread Guido van Rossum
y suggestions? Is constructing a > (dynamically-type-annotated) class in a function like this an anti-pattern? > > ___ > 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: __future__ annotations loses closure scope

2020-12-08 Thread Guido van Rossum
so the bar to change this is very high. (It's not the default behavior until 3.10 though, so theoretically there might be a little bit more wiggle room for that. So far you haven't shown sufficient evidence to consider that though.) -- --Guido van Rossum (python.org/~guido) *Pronouns: h

[Python-Dev] Re: __future__ annotations loses closure scope

2020-12-08 Thread Guido van Rossum
gt; On Tue, 2020-12-08 at 21:49 -0800, Guido van Rossum wrote: > > On Tue, Dec 8, 2020 at 8:58 PM Paul Bryan wrote: > > My use case is to for type annotations to resolve type encoders, decoders > and validators at runtime. > > > What is the reason you can't insist that t

[Python-Dev] Re: macOS issues with 3.8.7rc1

2020-12-09 Thread Guido van Rossum
python.org/mailman3/lists/python-dev.python.org/ >>> Message archived at >>> https://mail.python.org/archives/list/python-dev@python.org/message/5AWFX2POTPNVW72VUPCPTJIOA6AOSVWY/ >>> Code of Conduct: http://python.org/psf/codeofconduct/ >>> >> _

[Python-Dev] Re: macOS issues with 3.8.7rc1

2020-12-09 Thread Guido van Rossum
reliable and way outlives the OS updates. Even if an OS updates is still available, the newer OS often needs more memory, which can be a problem (most Apple hardware is hard to add memory to). What are people supposed to do? Just throw away their expensive computer? -- --Guido van Rossum (pytho

[Python-Dev] Re: Can lib2to3 and 2to3 be deprecated yet?

2020-12-10 Thread Guido van Rossum
g/message/JMZR5SNOE2TMVH4AQYRUSO6JXCZET5MD/ > 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: Runtime vs. Static Typing

2020-12-10 Thread Guido van Rossum
lias` type.) Hope this helps, --Guido On Thu, Dec 10, 2020 at 7:17 PM Paul Bryan wrote: > Per PEP 563: > > Most importantly, Guido van Rossum explicitly stated interest in gradually > restricting the use of annotations to static typing (with an optional > runtime component). > &

[Python-Dev] Re: unittest of sequence equality

2020-12-22 Thread Guido van Rossum
gt; 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/message/6Z43SU2RPIHTRABY

[Python-Dev] Re: Enhancement request for PyUnicode proxies

2020-12-26 Thread Guido van Rossum
it's an endless slog for the developers involved, and in open source it's hard to assign resources for such a project. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-u

[Python-Dev] Re: Enhancement request for PyUnicode proxies

2020-12-27 Thread Guido van Rossum
On Sun, Dec 27, 2020 at 3:19 AM Ronald Oussoren wrote: > > > On 26 Dec 2020, at 18:43, Guido van Rossum wrote: > > On Sat, Dec 26, 2020 at 3:54 AM Phil Thompson via Python-Dev < > python-dev@python.org> wrote: > >> It's worth comparing the situation with

[Python-Dev] Re: __init_subclass__ and metaclasses

2020-12-28 Thread Guido van Rossum
ons I can think of: >>> >>> - pass a keyword argument to type.__new__ that suppresses the call to >>> __init_subclass__; and >>> - provide a way to invoke new class' parent's __init_subclass__ before >>> returning it >>> >>> or >>&

[Python-Dev] Re: __init_subclass__ and metaclasses

2020-12-29 Thread Guido van Rossum
On Mon, Dec 28, 2020 at 10:24 PM Ethan Furman wrote: > On 12/28/20 9:31 PM, Guido van Rossum wrote: > > > Let me see if I can unpack this. > > > > I observe that `type.__new__() ` is really the C function `type_new()` > in typeobject.c, and hence I will refer to it

[Python-Dev] Re: __init_subclass__ and metaclasses

2020-12-29 Thread Guido van Rossum
--Guido On Tue, Dec 29, 2020 at 10:44 AM Ethan Furman wrote: > On 12/29/20 8:59 AM, Guido van Rossum wrote: > > On Mon, Dec 28, 2020 at 10:24 PM Ethan Furman wrote: > > >> The `__init_subclass__` and `__set_name__` protocols are intended to be > run before a new type is

[Python-Dev] Re: Enhancement request for PyUnicode proxies

2021-01-04 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

[Python-Dev] Re: Where is the SQLite module maintainer

2021-01-04 Thread Guido van Rossum
rg > 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/AM7AVQH6L4AQVTB5UFOBYXICDPXYZBKQ/ > Code of Conduct: http://p

[Python-Dev] Re: __init_subclass__ and metaclasses

2021-01-05 Thread Guido van Rossum
ituations where we're all still considered to be consenting adults -- surely abstract classes and methods are meant as a way to help users do the right thing, not as an absolute guarantee. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://fe

[Python-Dev] Re: 3.10 change (?) for __bool__

2021-01-11 Thread Guido van Rossum
; I'll start bisecting to try to track this down. It looks like "if a.b: >> pass" is getting partially optimized out; the disassembly shows a >> being loaded, its attribute b being looked up, and then it just jumps >> to the else - there's no POP_JUMP_IF_FALSE as

[Python-Dev] Re: Let's Fix Class Annotations -- And Maybe Annotations Generally

2021-01-11 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: 3.10 change (?) for __bool__

2021-01-11 Thread Guido van Rossum
Ah never mind. Seems to be a real bug -- thanks for reporting! On Mon, Jan 11, 2021 at 2:57 PM Mats Wichmann wrote: > On 1/11/21 1:00 PM, Guido van Rossum wrote: > > All that said (I agree it's surprising that 3.10 seems backwards > > incompatible here) I would

[Python-Dev] Re: Let's Fix Class Annotations -- And Maybe Annotations Generally

2021-01-11 Thread Guido van Rossum
org/message/DXQJ2V32YIV5KZQNFSPFVGKKVHIZDFPD/ > 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: Let's Fix Class Annotations -- And Maybe Annotations Generally

2021-01-11 Thread Guido van Rossum
On Mon, Jan 11, 2021 at 5:21 PM Larry Hastings wrote: > > On 1/11/21 4:39 PM, Guido van Rossum wrote: > > The easiest thing would be just to create an empty `__annotations__` for > classes that have no annotated variables, and to hell with the cost. > > I assume you'd

[Python-Dev] Re: Let's Fix Class Annotations -- And Maybe Annotations Generally

2021-01-11 Thread Guido van Rossum
Oh, but the behavior of annotations in e.g. mypy is the same. They are cumulative. On Mon, Jan 11, 2021 at 17:42 Larry Hastings wrote: > > On 1/11/21 5:28 PM, Guido van Rossum wrote: > > On Mon, Jan 11, 2021 at 5:21 PM Larry Hastings wrote: > >> Slots intelligently support

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

2021-01-11 Thread Guido van Rossum
eturn {"a": Outer.Inner, "b": Outer, "return": None} ``` (Note that for *function* locals you don't have to do anything, they just work, because of closures -- you may not understand them, but they are important here. :-) -- --Guido van Rossum (python.org/~guido) *Pro

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

2021-01-11 Thread Guido van Rossum
ype_hints() for which someone should file a bug on bpo, please! -- --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-De

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

2021-01-11 Thread Guido van Rossum
_annotations__` will just contain the string literal, so get_type_hints() would be needed to evaluate these. -- --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-

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

2021-01-12 Thread Guido van Rossum
about what values you put in as > annotations. You can put in strings, complex objects, > expressions--whatever you put in, you get back out later. > > I'm happy to add some text to the PEP if this needs clarifying; I just > thought it was obvious. > > > Cheers, > > &g

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

2021-01-12 Thread Guido van Rossum
Does that mean that the generated function would contain the entire expression `(int if random.random > 0.5 else float)`? I guess that's what it has to mean. But the PEP only uses such simple examples that it's easy to miss this. -- --Guido van Rossum (python.org/~guido) *Pronou

[Python-Dev] Re: Let's Fix Class Annotations -- And Maybe Annotations Generally

2021-01-12 Thread Guido van Rossum
gt;annotations. > > PEP 484 "explicitly does NOT prevent other uses of annotations". But if > you force everyone to use typing.get_type_hints() to examine their > annotations, then you have de facto prevented any use of annotations that > isn't compatible with type

[Python-Dev] Re: Let's Fix Class Annotations -- And Maybe Annotations Generally

2021-01-12 Thread Guido van Rossum
This has tripped up many people. Maybe we should just bite the bullet and change 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/>

<    9   10   11   12   13   14   15   16   17   18   >