Re: Detecting __future__ features

2007-07-30 Thread Steve Holden
Lawrence Oluyede wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> Is there any general mechanism? > > I'd just use the expected future feature and if the result is not what I > expect (or Python raises any kind of exception, like using a keyword not > present) I'd think I'm in the past :-)

Re: Detecting __future__ features

2007-07-30 Thread André
On Jul 30, 11:10 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-07-30, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > > Making the switch between different parser-implementations on > > the fly isn't technically impossible - but really, really, > > really complicated. But then, if it's lame

Re: Detecting __future__ features

2007-07-30 Thread Carsten Haese
On Mon, 2007-07-30 at 14:10 +, Neil Cerutti wrote: > On 2007-07-30, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > Making the switch between different parser-implementations on > > the fly isn't technically impossible - but really, really, > > really complicated. But then, if it's lameness suc

Re: Detecting __future__ features

2007-07-30 Thread Neil Cerutti
On 2007-07-30, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Making the switch between different parser-implementations on > the fly isn't technically impossible - but really, really, > really complicated. But then, if it's lameness sucks so much, > you might wanna take a stab at it? I was conside

Re: Detecting __future__ features

2007-07-30 Thread Jean-Paul Calderone
On Mon, 30 Jul 2007 15:48:00 +0200, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >Neil Cerutti wrote: > >> On 2007-07-30, André <[EMAIL PROTECTED]> wrote: >>> On Jul 30, 9:39 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: I don't understand the qualification, "at runtime," you're making. W

Re: Detecting __future__ features

2007-07-30 Thread Diez B. Roggisch
Neil Cerutti wrote: > On 2007-07-30, André <[EMAIL PROTECTED]> wrote: >> On Jul 30, 9:39 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: >>> I don't understand the qualification, "at runtime," you're >>> making. What's wrong with just importing what you want and >>> using it? If it's already been enab

Re: Detecting __future__ features

2007-07-30 Thread Carsten Haese
On Mon, 2007-07-30 at 12:53 +, André wrote: > On Jul 30, 9:39 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: > > On 2007-07-30, Steven D'Aprano > > > > <[EMAIL PROTECTED]> wrote: > > > How would one tell at runtime if a particular feature has been > > > enabled by the "from __future__ import thing

Re: Detecting __future__ features

2007-07-30 Thread Neil Cerutti
On 2007-07-30, André <[EMAIL PROTECTED]> wrote: > On Jul 30, 9:39 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: >> I don't understand the qualification, "at runtime," you're >> making. What's wrong with just importing what you want and >> using it? If it's already been enabled, no harm will come from

Re: Detecting __future__ features

2007-07-30 Thread Antti Rasinen
On 2007-07-30, at 15:29, Steven D'Aprano wrote: > How would one tell at runtime if a particular feature has been > enabled by > the "from __future__ import thing" statement? > > (I don't especially care whether the feature in question has been > enabled > via an explicit call to import, or be

Re: Detecting __future__ features

2007-07-30 Thread André
On Jul 30, 9:39 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-07-30, Steven D'Aprano > > <[EMAIL PROTECTED]> wrote: > > How would one tell at runtime if a particular feature has been > > enabled by the "from __future__ import thing" statement? > > I don't understand the qualification, "at r

Re: Detecting __future__ features

2007-07-30 Thread Neil Cerutti
On 2007-07-30, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > How would one tell at runtime if a particular feature has been > enabled by the "from __future__ import thing" statement? I don't understand the qualification, "at runtime," you're making. What's wrong with just importing what you want an

Re: Detecting __future__ features

2007-07-30 Thread Lawrence Oluyede
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Is there any general mechanism? I'd just use the expected future feature and if the result is not what I expect (or Python raises any kind of exception, like using a keyword not present) I'd think I'm in the past :-) -- Lawrence, oluyede.org - nerope

Detecting __future__ features

2007-07-30 Thread Steven D'Aprano
How would one tell at runtime if a particular feature has been enabled by the "from __future__ import thing" statement? For example, I can do this: if 1/2 == 0: print "classic division in use" else: print "true division in use" I could even do this: from keyword import keyword if keyw