Recommended "from __future__ import" options for Python 2.5.2?

Dan Bishop danb_83 at yahoo.com
Sat Apr 12 21:30:08 CEST 2008


On Apr 12, 1:41 pm, "Malcolm Greene" <pyt... at bdurham.com> wrote:
> Is there any consensus on what "from __future__ import" options
> developers should be using in their Python 2.5.2 applications?
>
> Is there a consolidated list of "from __future__ import" options to
> choose from?

Just look inside the __future__ module.

* nested_scopes
* generators

Already mandatory features.  You don't need to import them.

* with_statement

Import this one if you're using the feature.  And for forward
compatibility, don't use "with" as a variable name.

* absolute_import

I haven't followed this one.

* division

ALWAYS import this in new modules.  Otherwise, you'll be very likely
to get burned my code as simple as

def mean(seq):
    return sum(seq) / len(seq)



More information about the Python-list mailing list