Recommended "from __future__ import" options for Python 2.5.2?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Malcolm Greene

    Recommended "from __future__ import" options for Python 2.5.2?

    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?

    Thank you,
    Malcolm
  • Dan Bishop

    #2
    Re: Recommended "from __future__ import" options for Python 2.5.2?

    On Apr 12, 1:41 pm, "Malcolm Greene" <pyt...@bdurham .comwrote:
    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)

    Comment

    Working...