Re: Jython 2.7.0 final released!
"Stefan Richthofer" <[email protected]>
| Newsgroups | gmane.comp.lang.jython.devel |
|---|---|
| Message-ID | <trinity-945f1da8-9fbf-45f2-afd2-2b712d1bb556-1431129852209@3capp-gmx-bs62> |
> This would take much more than a conditional grammar, we'd have to > somehow keep two runtimes around and be able to mix them. We'd need > things like sometimes old style classes are permitted, sometimes not Hmmm I am honestly not 100% aware of all differences between Python 2 and 3 to consider, so please apoligize if my thoughts are too naive. Rather than two runtimes I imagine kind of one runtime that is the "Least common multiple" of Python 2 and 3. (Jython already delivers a runtime that is kind of "Least common multiple" of Python 2 and Java; extending this to Python 3 sounds almost simple compared to what has already been achieved) E.g. for the old- vs new-style classes concern: Python 2.7 already _has_ this mix of old- and new style classes and deciding whether to permit old ones would be trivial due to a different import-directive. However, if you say it can't be done (with reasonable effort), I trust you and won't discuss further. I just wanted to make sure, the idea was considered. Regards Stefan > Gesendet: Samstag, 09. Mai 2015 um 01:31 Uhr > Von: "[email protected]" <[email protected]> > An: "Stefan Richthofer" <[email protected]> > Cc: "Jython Developers" <[email protected]> > Betreff: Re: Re: [Jython-dev] Jython 2.7.0 final released! > > On Fri, May 8, 2015 at 5:41 AM, Stefan Richthofer > <[email protected]> wrote: > >>>grammar to keep 2.7 and 3.5 sort of parsing at the same time > > > > I had no idea this would be actually possible, but it sounds > > very interesting. Did you consider this as an actual feature > > for Jython3? > What might make sense someday if I have time would be conditional > parsing of either with the same grammar. Actually parsing at the same > time creates terrible things (and I am perpetrating terrible things > for now). > > For example, raise_stmt in Python2 is (from CPython's Grammar) looks like: > raise_stmt: 'raise' [test [',' test [',' test]]] > > Python3's is: > raise_stmt: 'raise' [test ['from' test]] > > What I am doing would translate to: > raise_stmt: 'raise' [test ['from'][',' test [',' test]]] > > Which would allow horrors like: > > raise Exception from None, foo, bar > > > Did you consider this as an actual feature > > for Jython3? Parsing 2.7 and 3.5 at the same time sounds weired, > > but what about something like a new import directive, let's say > > "import2" to import code that is known to be Python 2.7? > This would take much more than a conditional grammar, we'd have to > somehow keep two runtimes around and be able to mix them. We'd need > things like sometimes old style classes are permitted, sometimes not, > etc. That's definitely too hard (at least for me) and probably way too > ugly. Although it is the sort of crazy thing that can sometimes > interests Jim :) > > -Frank > ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y