Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-13 Thread Ivan Levkivskyi
> The difference in allocated memory is over 22 MB. > The import time with annotations is over 2s longer. > The problem with those numbers that we still have 80% functions to cover. This will not be a problem with PEP 560 (I could imagine that string objects may take actually more memory than

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-12 Thread Lukasz Langa
Thanks for your detailed review! > On Sep 11, 2017, at 9:45 PM, Steven D'Aprano wrote: > > Regarding forward references: I see no problem with quoting forward > references. Some people complain about the quotation marks, but frankly > I don't think that's a major

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-12 Thread Lukasz Langa
> On Sep 12, 2017, at 5:38 AM, Ivan Levkivskyi wrote: > > In principle, I like this idea, this will save some keystrokes > and will make annotated code more "beautiful". But I am quite worried about > the backwards > compatibility. One possible idea would be to use

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-12 Thread Lukasz Langa
> On Sep 11, 2017, at 4:21 PM, Yury Selivanov wrote: > > I'm one of those who used annotations for other purposes than type > hints. And even if annotations became strings in Python 3.7 *without > future import*, fixing my libraries would be easy -- just add an >

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-12 Thread Steven D'Aprano
On Tue, Sep 12, 2017 at 09:17:23PM +1000, Nick Coghlan wrote: > Unfortunately, this idea has the downside that for trivial > annotations, defining a lambda expression is likely to be *slower* > than evaluating the expression, whereas referencing a string constant > is faster: Is it time to

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-12 Thread Nick Coghlan
On 12 September 2017 at 11:45, Steven D'Aprano wrote: >> Rejected Ideas >> == >> >> Keep the ability to use local state when defining annotations >> - >> >> With postponed evaluation, this is impossible

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-12 Thread Ivan Levkivskyi
In principle, I like this idea, this will save some keystrokes and will make annotated code more "beautiful". But I am quite worried about the backwards compatibility. One possible idea would be to use __future__ import without a definite deprecation plan. If people will be fine with using

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-12 Thread Stefan Behnel
Lukasz Langa schrieb am 11.09.2017 um 21:25: > I remember mostly Stefan Behnel's concerns about Cython's annotations, I'm currently reimplementing the annotation typing in Cython to be compatible with PEP-484, so that concern is pretty much out of the way. This PEP still has an impact on Cython,

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-11 Thread Ethan Smith
On Mon, Sep 11, 2017 at 1:21 PM, Yury Selivanov wrote: > On Mon, Sep 11, 2017 at 3:25 PM, Lukasz Langa wrote: > [..] > > This PEP is proposing delaying evaluation until annotations are accessed > but > > gives user code the power to decide whether the

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-11 Thread Yury Selivanov
On Mon, Sep 11, 2017 at 3:25 PM, Lukasz Langa wrote: [..] > This PEP is proposing delaying evaluation until annotations are accessed but > gives user code the power to decide whether the string form is enough, or > maybe an AST would be enough, or actual evaluation with

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-11 Thread Lukasz Langa
> On Sep 11, 2017, at 3:23 PM, Stefan Behnel wrote: > > Ryan Gonzalez schrieb am 11.09.2017 um 19:16: >> One thing I want to point out: there are a lot of really useful Python >> libraries that have come to rely on annotations being objects, ranging >> from plac to fbuild

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-11 Thread Guido van Rossum
On Mon, Sep 11, 2017 at 10:16 AM, Ryan Gonzalez wrote: > One thing I want to point out: there are a lot of really useful Python > libraries that have come to rely on annotations being objects, ranging > from plac to fbuild to many others. I could understand something that >

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-11 Thread Lukasz Langa
> On Sep 11, 2017, at 1:16 PM, Ryan Gonzalez wrote: > > One thing I want to point out: there are a lot of really useful Python > libraries that have come to rely on annotations being objects, ranging > from plac to fbuild to many others. Shout out to fbuild which is a project

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-11 Thread Stefan Behnel
Ryan Gonzalez schrieb am 11.09.2017 um 19:16: > One thing I want to point out: there are a lot of really useful Python > libraries that have come to rely on annotations being objects, ranging > from plac to fbuild to many others. I could understand something that > delays the evaluation of

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-11 Thread אלעזר
On Mon, Sep 11, 2017 at 10:07 PM Lukasz Langa wrote: > This is off topic for discussion of this PEP. > > It would require another one (essentially an extension of PEP 484) to get > passed for your idea to be standardized. > I'm not sure whether this is directed to me; so just

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-11 Thread אלעזר
On Mon, Sep 11, 2017 at 8:58 PM Steven D'Aprano wrote: > On Mon, Sep 11, 2017 at 04:06:14PM +, אלעזר wrote: > > I like it. For previous discussion of this idea see here: > > > https://mail.python.org/pipermail/python-ideas/2016-September/042527.html > > > > I don't see

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-11 Thread Steven D'Aprano
On Mon, Sep 11, 2017 at 04:06:14PM +, אלעזר wrote: > I like it. For previous discussion of this idea see here: > https://mail.python.org/pipermail/python-ideas/2016-September/042527.html > > I don't see this mentioned in the PEP, but it will also allow (easy) > description of contracts and

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-11 Thread Ryan Gonzalez
One thing I want to point out: there are a lot of really useful Python libraries that have come to rely on annotations being objects, ranging from plac to fbuild to many others. I could understand something that delays the evaluation of annotations until they are accessed, but this seems really

Re: [Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

2017-09-11 Thread אלעזר
I like it. For previous discussion of this idea see here: https://mail.python.org/pipermail/python-ideas/2016-September/042527.html I don't see this mentioned in the PEP, but it will also allow (easy) description of contracts and dependent types. Elazar On Mon, Sep 11, 2017 at 6:59 PM Lukasz