Detecting __future__ features
Neil Cerutti
horpner at yahoo.com
Mon Jul 30 09:02:17 EDT 2007
On 2007-07-30, André <andre.roberge at gmail.com> wrote:
> On Jul 30, 9:39 am, Neil Cerutti <horp... at yahoo.com> 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
>> the import statement.
>>
>
> I'm not the OP, so perhaps I am missing his intent. However, I
> can see a good reason for asking this question.
>
> I seem to recall that the "from __future__ import" statement
> can only be done at the beginning of a script. What if you are
> designing a module meant to be imported, and used by other
> programs over which you have no control? You can't use "from
> __future__ import" in your module. So, you may have to find a
> way to figure out what's been done. (the example given with
> the division operator is a good one).
Is "from __future__ import" really that lame?
--
Neil Cerutti
8 new choir robes are currently needed, due to the addition of several new
members and to the deterioration of some of the older ones. --Church Bulletin
Blooper
More information about the Python-list
mailing list