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

2021-04-23 Thread Larry Hastings
On 4/23/21 9:26 PM, Guido van Rossum wrote: This is happening, right? Adding a default `__annotations = {}` to modules and classes. (Though https://bugs.python.org/issue43901 seems temporarily stuck.) It's happening, and I wouldn't say it's stuck.  I'm act

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

2021-04-23 Thread Guido van Rossum
This is happening, right? Adding a default `__annotations = {}` to modules and classes. (Though https://bugs.python.org/issue43901 seems temporarily stuck.) On Mon, Apr 19, 2021 at 10:10 PM Larry Hastings wrote: > > > As long as I'm gravedigging old conversations...! Remember this one, also > f

[Python-Dev] Re: Interaction of PEP 563's Annotations with Symbol Table

2021-04-23 Thread Guido van Rossum
+1 to what Jelle said -- I don't see anyone seriously using this except in code golf or obfuscated code contests. On Fri, Apr 23, 2021 at 11:51 AM Jelle Zijlstra wrote: > For what it's worth, Larry's PEP 649 branch currently prohibits yield, > yield from, await, and the walrus operator in annota

[Python-Dev] Re: Keeping Python a Duck Typed Language.

2021-04-23 Thread Chris Angelico
On Sat, Apr 24, 2021 at 10:14 AM Nick Coghlan wrote: > > > > On Sat, 24 Apr 2021, 10:02 am Skip Montanaro, > wrote: >> >> >>> Practically speaking, one issue I have is how easy it is to write >>> isinstance or issubclass checks. It has historically been much more >>> difficult to write and mai

[Python-Dev] Re: Keeping Python a Duck Typed Language.

2021-04-23 Thread Nick Coghlan
On Fri, 23 Apr 2021, 12:34 pm Inada Naoki, wrote: > > I think using ABC to distinguish sequence or mapping is a bad idea. > > There are three policies: > > a) Use duck-typing; just us it as sequence. No type check at all. > b) Use strict type checking; isinstance(x, list) / isinstance(x, (list, >

[Python-Dev] Re: Keeping Python a Duck Typed Language.

2021-04-23 Thread Nick Coghlan
On Sat, 24 Apr 2021, 10:02 am Skip Montanaro, wrote: > > Practically speaking, one issue I have is how easy it is to write >> isinstance or issubclass checks. It has historically been much more >> difficult to write and maintain a check that something looks like a duck. >> >> `if hasattr(foo, 'c

[Python-Dev] Re: Keeping Python a Duck Typed Language.

2021-04-23 Thread Skip Montanaro
> Practically speaking, one issue I have is how easy it is to write > isinstance or issubclass checks. It has historically been much more > difficult to write and maintain a check that something looks like a duck. > > `if hasattr(foo, 'close') and hasattr(foo, 'seek') and hasattr(foo, > 'read'):`

[Python-Dev] Re: Keeping Python a Duck Typed Language.

2021-04-23 Thread Gregory P. Smith
When reading this, I wrote most of it early and left a draft to bake Then deleted a ton of it after other people replied. I'm conscious that my terminology might be all over the map. Keep that in mind before hitting reply. It'll take me a while to digest and pedantically use Luciano's terms,

[Python-Dev] Re: Keeping Python a Duck Typed Language.

2021-04-23 Thread Caleb Donovick
We can add .keys() to Mapping to distinguish Mapping and Sequence. But it is breaking change, of course. We shouldn’t change it. We could use the presence of .keys in the subclasses hook only after first checking explicit cases (i.e. actual subclass or has been registered). Yes this would break co

[Python-Dev] Request For Review: Fix test_socket.CANTest.testSendFrame (bpo-40297)

2021-04-23 Thread Karl Ding
Hi all, Could someone help take a look at the following PR, which fixes one of the broken socket module tests that exercises part of the standard library? PR Link: https://github.com/python/cpython/pull/19548 BPO Link: https://bugs.python.org/issue40297 The test can be run locally on Linux by se

[Python-Dev] Asking for clarifications in PEP 646 and postponing to Python 3.11

2021-04-23 Thread Brett Cannon
First, the SC is postponing considering accepting https://www.python.org/dev/peps/pep-0646/ any further until Python 3.11. There's unfortunately not enough time before b1 to get requested updates into the PEP, discuss the PEP again, approve it, and then review an implementation thoroughly. Second,

[Python-Dev] Re: Interaction of PEP 563's Annotations with Symbol Table

2021-04-23 Thread Jelle Zijlstra
For what it's worth, Larry's PEP 649 branch currently prohibits yield, yield from, await, and the walrus operator in annotations. That seems like the right choice unless there's some realistic use case for any of these. El vie, 23 abr 2021 a las 11:27, Batuhan Taskaya () escribió: > About 4 month

[Python-Dev] Interaction of PEP 563's Annotations with Symbol Table

2021-04-23 Thread Batuhan Taskaya
About 4 months ago, I've created bpo-42725 in order to resolve some of the points below though I decided to postpone it for various reasons that blocked it completely until the point of where we have a beta cut in a week or so. So I'm asking for comments regarding how should we resolve this behavio

[Python-Dev] Summary of Python tracker Issues

2021-04-23 Thread Python tracker
ACTIVITY SUMMARY (2021-04-16 - 2021-04-23) Python tracker at https://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open7474 (-48) closed 48187 (+101) total 55661 (+53) Open issues

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

2021-04-23 Thread gopinathinchennai01
How does C++ fare in binary compatibility? Last time I checked it out (about 10 years ago), there was completely none, every compiler's ABI https://www.credosystemz.com/courses/aws-training-chennai/ ___ Python-Dev mailing list -- python-dev@python.org

[Python-Dev] Re: Anyone else gotten bizarre personal replies to mailing list posts?

2021-04-23 Thread Sebastian Rittau
Am 23.04.21 um 17:38 schrieb Nathaniel Smith: I just got the reply below sent directly to my personal account, and I'm confused about what's going on. If it's just a one off I'll chalk it up to random internet weirdness, but if other folks are getting these too it might be something the list ad

[Python-Dev] Re: Anyone else gotten bizarre personal replies to mailing list posts?

2021-04-23 Thread David Mertz
This reads like a much worse variation on GPT-3. On Fri, Apr 23, 2021, 11:52 AM Pablo Galindo Salgado wrote: > I had I and still don't know what's going on. Mine was in a response to a > release announcement so it was extra weird. Here is what I received: > > I have now formally filed a final la

[Python-Dev] Re: Anyone else gotten bizarre personal replies to mailing list posts?

2021-04-23 Thread Antoine Pitrou
Perhaps an unconventional artistic performance ;-) But more probably some kind of loony with a lot of free time... On Fri, 23 Apr 2021 16:49:15 +0100 Pablo Galindo Salgado wrote: > I had I and still don't know what's going on. Mine was in a response to a > release announcement so it was extra w

[Python-Dev] Re: Anyone else gotten bizarre personal replies to mailing list posts?

2021-04-23 Thread Pablo Galindo Salgado
I had I and still don't know what's going on. Mine was in a response to a release announcement so it was extra weird. Here is what I received: I have now formally filed a final lawsuit against the manager of the python > program company, because all of him is also a criminal act, and GNU has EU >

[Python-Dev] Re: Anyone else gotten bizarre personal replies to mailing list posts?

2021-04-23 Thread Jelle Zijlstra
I got a few of these too. I'm not sure anything can be done about it, since the mailing list is publicly archived, so anyone could send emails to anyone who posts here. El vie, 23 abr 2021 a las 8:42, Nathaniel Smith () escribió: > I just got the reply below sent directly to my personal account,

[Python-Dev] Anyone else gotten bizarre personal replies to mailing list posts?

2021-04-23 Thread Nathaniel Smith
I just got the reply below sent directly to my personal account, and I'm confused about what's going on. If it's just a one off I'll chalk it up to random internet weirdness, but if other folks are getting these too it might be something the list admins should look into? Or... something? -

[Python-Dev] Re: PEP 654: Exception Groups and except* [REPOST]

2021-04-23 Thread Irit Katriel via Python-Dev
On Fri, Apr 23, 2021 at 9:22 AM Nathaniel Smith wrote: > On Wed, Apr 21, 2021 at 4:50 PM Guido van Rossum wrote: > > On Wed, Apr 21, 2021 at 3:26 PM Nathaniel Smith wrote: > >> Sure. This was in my list of reasons why the backwards compatibility > >> tradeoffs are forcing us into awkward compro

[Python-Dev] Re: OTish: Define Protocols near consumers [was: Keeping Python a Duck Typed Language.]

2021-04-23 Thread Paul Moore
On Fri, 23 Apr 2021 at 10:31, Stephen J. Turnbull wrote: > SJIS = 'shift_jisx0213' > > *Now* that is a personal protocol, serving the same function of > telling me "this code deals with a legacy Japanese encoding" and > implementing it behind the scenes. But I don't see how that can be > "define

[Python-Dev] Re: PEP 654: Exception Groups and except* [REPOST]

2021-04-23 Thread Chris Angelico
On Fri, Apr 23, 2021 at 6:25 PM Nathaniel Smith wrote: > > On Wed, Apr 21, 2021 at 4:50 PM Guido van Rossum wrote: > > On Wed, Apr 21, 2021 at 3:26 PM Nathaniel Smith wrote: > >> Sure. This was in my list of reasons why the backwards compatibility > >> tradeoffs are forcing us into awkward compr

[Python-Dev] OTish: Define Protocols near consumers [was: Keeping Python a Duck Typed Language.]

2021-04-23 Thread Stephen J. Turnbull
Luciano Ramalho writes: > A HUGE insight I learned studying Go is that Protocols should be > defined near the code that CONSUMES it, and not near the code that > PROVIDES it. That's exactly the opposite of how we use ABCs, or > Java folks use interfaces (most of the time). I don't see how tha

[Python-Dev] Re: PEP 654: Exception Groups and except* [REPOST]

2021-04-23 Thread Nathaniel Smith
On Wed, Apr 21, 2021 at 4:50 PM Guido van Rossum wrote: > On Wed, Apr 21, 2021 at 3:26 PM Nathaniel Smith wrote: >> Sure. This was in my list of reasons why the backwards compatibility >> tradeoffs are forcing us into awkward compromises. I only elaborated >> on it b/c in your last email you said