473,226 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

Visibility of symbols between extension modules

Hi all,
I have been learning to write extension modules using the C API that
python provides, and have hit a minor roadblock that is turning out to
be major headache.
My project essentially is organized as follows,

foo
|
---------------------------------
| | |
bar _foo baz

_foo basically does some init stuff, nothing much. Thats where the
problem starts. The "handler" variable which is initialized in _foo
isn't visible to others. One solution that worked was calling the
initializing function in each of the module's PyMODINIT_FUNC. Debugging
through the interpreter I found out the it loads all the .so's and
executes PyMODINIT_FUNCs. But by doing so, the routine to initialize the
handle gets executed three times, something which i find to be sort of
unclean.
The definition of the variable is included in a header and the sources
of the other modules include this master header, So I do have that
variable in scope, but its not initialized. _foo does the job of
declaring that variable.
I did my share of RTFM and found CObjects as a potential alternative.
But I feel its use rather complicated for a single variable that goes
out of scope. Is there any other way to solve this, or is my approach
itself borked =(?, What am I missing?

Thanks for your help
--
Sudharshan S
http://www.sudharsh.wordpress.com

Oct 21 '07 #1
0 866

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: glaserp | last post by:
Hi, I am developing a Windows application with C# in Visual Stuio .NET. My application references three assemblies that are developed in another project. I have added these assemblies as...
47
by: Pierre Barbier de Reuille | last post by:
Please, note that I am entirely open for every points on this proposal (which I do not dare yet to call PEP). Abstract ======== This proposal suggests to add symbols into Python. Symbols...
1
by: wylbur via DotNetMonster.com | last post by:
I'm having a problem with establishing breakpoints in DbgCLR Version 2.0. I've set breakpoints for statements in Page_Init, and they were never triggered when I loaded the webpage. In the code...
0
by: wASP | last post by:
Hi, I'm posting this again - I'm having some kind of a problem with my posts disappearing ... I'm having a problem with establishing breakpoints in DbgCLR Version 2.0. I've set...
0
by: wASP | last post by:
Hi, I'm having a problem with establishing breakpoints in DbgCLR Version 2.0. I've set breakpoints for statements in Page_Init, and they were never triggered when I loaded the webpage. I place...
1
by: zpinhead | last post by:
I am unable to get my downloaded extension from pecl to link up with php properly. seems like the php.so I could not use pear install http. pear claimed the extension was already installed....
1
by: Petr Prikryl | last post by:
Do you think that the following could became PEP (pre PEP). Please, read it, comment it, reformulate it,... Abstract Introduction of the mechanism for language extensions via modules...
7
by: 2b|!2b==? | last post by:
I am attempting to manually load debug symbols for a module. I am doing it by carrying out the ff steps: i). Select the call stack window ii). right click and select 'Load Symbols' from...
0
by: sudharsh | last post by:
Hi all, I have been learning to write Python extension modules, and am quite at a loss over a small glitch thats taking place. When I import my module I get the following exception Traceback...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.