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 8233845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:16:02+00:00 2026-06-07T18:16:02+00:00

Can I place: from __future__ import absolute_import inside __init__.py on the top level dir

  • 0

Can I place:

from __future__ import absolute_import

inside __init__.py on the top level dir on my package and garantee that the absolute_import will be applied to all code that runs inside that package or sub-packages?

Or should I put that directive in each model that does an absolute import?

I maintain a Python package and I’m trying to keep my code as easy as possible to migrate to Python3 when the time comes. I can’t do it right away because my dependencies are not on Python3 yet.

  • 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-06-07T18:16:04+00:00Added an answer on June 7, 2026 at 6:16 pm

    No, __future__ imports are only valid for a single file. You will have to put this line at the top of every Python source file.

    From the documentation:

    A future statement is a directive to the compiler that a particular module should be compiled using syntax or semantics that will be available in a specified future release of Python.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can you refer me to a good starting place for learning GAE from what
How I can draw picture from drawable resources in place where I click? I
Can I store the Geolocation (lat,long) for a place, business from Google Maps in
Can someone suggest how I can place a logo image on the top of
I have custom component that I can place in my layout file (XML) for
I am trying to add padding-right to an input so that I can place
From my understanding of hashing in general, one changed character any place can throw
I've learnt from here that a const reference can be made out of an
So the example from the wiki has phantom.exit() in two places here. Why can't
Where in this pattern I can place services, about which I some much hear

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.