Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6319173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:45:36+00:00 2026-05-24T15:45:36+00:00

__future__ frequently appears in Python modules. I do not understand what __future__ is for

  • 0

__future__ frequently appears in Python modules. I do not understand what __future__ is for and how/when to use it even after reading the Python’s __future__ doc.

Can anyone explain with examples?

A few answers regarding the basic usage of __future__ I’ve received seemed correct.

However, I need to understand one more thing regarding how __future__ works:

The most confusing concept for me is how a current python release includes features for future releases, and how a program using a feature from a future release can be be compiled successfully in the current version of Python.

I am guessing that the current release is packaged with potential features for the future. However, the features are available only by using __future__ because they are not the current standard. Let me know if I am right.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T15:45:37+00:00Added an answer on May 24, 2026 at 3:45 pm

    With __future__ module’s inclusion, you can slowly be accustomed to incompatible changes or to such ones introducing new keywords.

    E.g., for using context managers, you had to do from __future__ import with_statement in 2.5, as the with keyword was new and shouldn’t be used as variable names any longer. In order to use with as a Python keyword in Python 2.5 or older, you will need to use the import from above.

    Another example is

    from __future__ import division
    print 8/7  # prints 1.1428571428571428
    print 8//7 # prints 1
    

    Without the __future__ stuff, both print statements would print 1.

    The internal difference is that without that import, / is mapped to the __div__() method, while with it, __truediv__() is used. (In any case, // calls __floordiv__().)

    Apropos print: print becomes a function in 3.x, losing its special property as a keyword. So it is the other way round.

    >>> print
    
    >>> from __future__ import print_function
    >>> print
    <built-in function print>
    >>>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I frequently use the Remove and sort usings feature of VS/PowerCommands - in fact,
How can I predict the future size / growth of an Oracle table? Assuming:
I'm currently looking at the Python framework Django for future db-based web apps as
I'm frequently run into a situation where I need to report in some way
What are some possible designs to deal with frequently changing data forms? I have
Is there a commonly-accepted practice for designing java objects that are frequently loaded and
Has anyone encountered this error using SQL Server 2005 and Data access application blocks
I've read chapter 7 in the 'Linux Device Drivers' (which can be found here)
I started using Python in 2001. I loved the simplicity of the language, but
I could really use some good feedback on best practices / insight on whether

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.