Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document module __init__ #8923

Closed
stevengj opened this issue Nov 7, 2014 · 3 comments · Fixed by #9240
Closed

document module __init__ #8923

stevengj opened this issue Nov 7, 2014 · 3 comments · Fixed by #9240
Labels
docs This change adds or pertains to documentation
Milestone

Comments

@stevengj
Copy link
Member

stevengj commented Nov 7, 2014

Module initialization functions were added in #1268 and updated in #5960, but never seem to have been documented (outside of the NEWS file).

@stevengj stevengj added the docs This change adds or pertains to documentation label Nov 7, 2014
@stevengj stevengj changed the title document module _init document module __init__ Nov 7, 2014
@ViralBShah ViralBShah added this to the 0.4 milestone Nov 7, 2014
@pluskid
Copy link
Member

pluskid commented Nov 11, 2014

When is the __init__ function of a module called? Is there any way to explicitly initialize a module?

My issue is that I need a lower level wrap of a function into BLAS. But calling my own wrapper will crash since the BLAS library has not been initialized. Currently I make a dummy call to the built-in BLAS procedures to get the library initialized. But I wander is there better way to do that?

@stevengj
Copy link
Member Author

I think __init__ is called when the module is loaded into memory for the first time, e.g. via import or require or using.

@pluskid
Copy link
Member

pluskid commented Nov 11, 2014

@stevengj Yes, that works! Thanks!

stevengj added a commit to stevengj/julia that referenced this issue Dec 3, 2014
stevengj added a commit to stevengj/julia that referenced this issue Dec 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants