Recommended "from __future__ import" options for Python 2.5.2?

Discussion in 'Python' started by Malcolm Greene, Apr 12, 2008.

  1. 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
     
    Malcolm Greene, Apr 12, 2008
    #1
    1. Advertising

  2. Malcolm Greene

    Dan Bishop Guest

    On Apr 12, 1:41 pm, "Malcolm Greene" <> 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)
     
    Dan Bishop, Apr 12, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Logan
    Replies:
    3
    Views:
    818
    Michael Hudson
    Nov 25, 2003
  2. Jacek Generowicz

    from __future__ import decorators

    Jacek Generowicz, Jan 13, 2005, in forum: Python
    Replies:
    8
    Views:
    395
    Jacek Generowicz
    Jan 17, 2005
  3. Replies:
    2
    Views:
    324
  4. Ron Adam
    Replies:
    7
    Views:
    527
    Ron Adam
    Feb 9, 2007
  5. Replies:
    8
    Views:
    735
    Roy Smith
    Apr 20, 2008
Loading...

Share This Page