Recommended "from __future__ import" options for Python 2.5.2?

M

Malcolm Greene

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
 
D

Dan Bishop

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)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top