This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yselivanov
Recipients abarnert, benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, serhiy.storchaka, vstinner, yselivanov
Date 2016-02-05.22:35:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1454711733.57.0.861174210962.issue26297@psf.upfronthosting.co.za>
In-reply-to
Content
> ast.Constant is *not* emited by the compiler to not break backward
compatibility. I *know* that there is no stable API on AST, but I
noticed some issues when working on my AST project. For example, pip
doesn't work because an internal library uses AST and the code doesn't
handle ast.Constant (it's probably super easy to fix it).

Yeah, it's probably very easy to fix.  And if pip stops working on 3.6-alpha it will be fixed.  We don't give any guarantees on AST backwards compatibility.  In fact, we even tell that the AST might change in every release in the docs "The abstract syntax itself might change with each Python release".


> I'm open to change the compiler to emit ast.Constant directly, but
maybe only in "optimized mode" (ex: python -O?). 

I'm -1 on using -O flag since some people would prefer to have optimizations *and* have their assert statements.

In fact I'm -1 on using any kind of flag to trigger optimizations on or off.  Those flags will only drive confusion.  If the optimizations are any good, people will simply start using the flag all the time.
History
Date User Action Args
2016-02-05 22:35:33yselivanovsetrecipients: + yselivanov, brett.cannon, georg.brandl, ncoghlan, vstinner, benjamin.peterson, serhiy.storchaka, abarnert
2016-02-05 22:35:33yselivanovsetmessageid: <1454711733.57.0.861174210962.issue26297@psf.upfronthosting.co.za>
2016-02-05 22:35:33yselivanovlinkissue26297 messages
2016-02-05 22:35:33yselivanovcreate