Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Recommended "from __future__ import" options for Python 2.5.2?

Reply
Thread Tools

Recommended "from __future__ import" options for Python 2.5.2?

 
 
Malcolm Greene
Guest
Posts: n/a
 
      04-12-2008
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
 
Reply With Quote
 
 
 
 
Dan Bishop
Guest
Posts: n/a
 
      04-12-2008
On Apr 12, 1:41 pm, "Malcolm Greene" <(E-Mail Removed)> 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)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
recommended __future__ imports for 2.5? Joe Strout Python 0 11-24-2008 08:36 PM
Strange __future__ behavior in Python 2.5 mdsteele@gmail.com Python 3 09-24-2006 03:08 PM
Recommended command line options for new rubyists John Maclean Ruby 4 01-05-2006 05:48 PM
from __future__ import decorators Jacek Generowicz Python 8 01-17-2005 08:26 AM
'from __future__ import ...' overview Logan Python 3 11-25-2003 11:47 AM



Advertisments