Re: [Python-Dev] Remove typing from the stdlib

2017-11-04 Thread Paul Moore
On 4 November 2017 at 03:53, Nick Coghlan wrote: > If I understand correctly, a lot of the complexity in the current > typing.py implementation is there to make isinstance and issubclass do > something "useful" at runtime, and to allow generics to be used as > base classes. > > If it wasn't for th

Re: [Python-Dev] PEP 563: Postponed Evaluation of Annotations

2017-11-04 Thread Nick Coghlan
On 4 November 2017 at 00:40, Guido van Rossum wrote: > IMO the inability of referencing class-level definitions from annotations on > methods pretty much kills this idea. If we decided we wanted to make it work, I think the key runtime building block we would need is a new kind of cell reference:

[Python-Dev] Guarantee ordered dict literals in v3.7?

2017-11-04 Thread Stefan Krah
Hello, would it be possible to guarantee that dict literals are ordered in v3.7? The issue is well-known and the workarounds are tedious, example: https://mail.python.org/pipermail/python-ideas/2015-December/037423.html If the feature is guaranteed now, people can rely on it around v3.9.

Re: [Python-Dev] PEP 563: Postponed Evaluation of Annotations

2017-11-04 Thread Guido van Rossum
I'm very worried about trying to come up with a robust implementation of this in under 12 weeks. By contrast, the stringification that Łukasz is proposing feels eminently doable. On Sat, Nov 4, 2017 at 6:51 AM, Nick Coghlan wrote: > On 4 November 2017 at 00:40, Guido van Rossum wrote: > > IMO t

Re: [Python-Dev] Guarantee ordered dict literals in v3.7?

2017-11-04 Thread Guido van Rossum
This sounds reasonable -- I think when we introduced this in 3.6 we were worried that other implementations (e.g. Jython) would have a problem with this, but AFAIK they've reported back that they can do this just fine. So let's just document this as a language guarantee. On Sat, Nov 4, 2017 at 10:

Re: [Python-Dev] PEP 563: Postponed Evaluation of Annotations

2017-11-04 Thread Peter Ludemann via Python-Dev
If type annotations are treated like implicit lambdas, then that's a first step to something similar to Lisp's "special forms". A full generalization of that would allow, for example, logging.debug to not evaluate its args unless debugging is turned on (I use a logging.debug wrapper that allows lam

Re: [Python-Dev] Guarantee ordered dict literals in v3.7?

2017-11-04 Thread Jim Baker
+1, as Guido correctly recalls, this language guarantee will work well with Jython when we get to the point of implementing 3.7+. On Sat, Nov 4, 2017 at 12:35 PM, Guido van Rossum wrote: > This sounds reasonable -- I think when we introduced this in 3.6 we were > worried that other implementatio

Re: [Python-Dev] PEP 563: Postponed Evaluation of Annotations

2017-11-04 Thread Nick Coghlan
On 5 November 2017 at 02:42, Guido van Rossum wrote: > I'm very worried about trying to come up with a robust implementation of > this in under 12 weeks. By contrast, the stringification that Łukasz is > proposing feels eminently doable. I'm far from confident about that, as the string proposal i

Re: [Python-Dev] Guarantee ordered dict literals in v3.7?

2017-11-04 Thread Nick Coghlan
On 5 November 2017 at 04:35, Guido van Rossum wrote: > This sounds reasonable -- I think when we introduced this in 3.6 we were > worried that other implementations (e.g. Jython) would have a problem with > this, but AFAIK they've reported back that they can do this just fine. So > let's just docu