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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:54:10+00:00 2026-05-24T02:54:10+00:00

The Boost documentation does not specify this. When I use boost::python::import , where exactly

  • 0

The Boost documentation does not specify this. When I use boost::python::import, where exactly is the specified module imported? My guess would be in '__main__' (just to make sure).

Also, what happens when the module object goes out of scope? Given the wording in Boost’s docs — “Returns: An instance of object which holds a reference to the imported module” — I would guess only the reference goes out of scope, the module object is still found within '__main__' (or wherever it was imported).

  • 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-24T02:54:11+00:00Added an answer on May 24, 2026 at 2:54 am

    The underlying mechanism is PyImport_ImportModule, and no, it doesn’t touch __main__. Successfully imported modules are inserted into sys.modules dict, so the object is not freed when you DECREF what the function returns — there is still at least that one reference alive.

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

Sidebar

Related Questions

Why does tuple documentation say to use, for example: #include boost/tuple/tuple.hpp and not #include
I am a bit perplexed by the Boost ublas documentation. It does not seem
This is an embarrassing question, but even the well-written documentation provided with boost.interprocess hasn't
I've stared at the Boost.Interprocess documentation for hours but still haven't been able to
I'm looking for documentation on boost::threadpool. I downloaded the source and documentation zip files.
Several times, while perusing the Boost library's documentation, I've run across return values that
The documentation available on the boost website is... limited. From what I've been able
The py2app documentation mentions prescripts, being run by __boot__.py prior to the main python
From the documentation on the boost site for lexical cast it states that when
From an example [1] in the documentation for boost::iterator_facade: class node_iterator : public boost::iterator_facade<

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.