[issue13431] Pass context information into the extension module init function

2011-11-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- title: Pass context information into the extension module init function -> Pass context information into the extension module init function ___ Python tracker _

[issue13431] Pass context information into the extension module init function

2011-11-20 Thread Martin v . Löwis
Martin v. Löwis added the comment: > Python interpreter already have that information internally. The > initial proposal was to pass it to the init as an additional > parameter. My suggestion is to export it as a new function that the > init can call if VERSION >=3.3. Jesus: Please try to come

[issue13431] Pass context information into the extension module init function

2011-11-20 Thread Stefan Behnel
Stefan Behnel added the comment: The problem with having that information "internally" is that it's currently stored in local variables in the call chain from the dynamic library loader. Passing that information on into a callable function, without passing it as an argument into the init func

[issue13431] Pass context information into the extension module init function

2011-11-20 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Python interpreter already have that information internally. The initial proposal was to pass it to the init as an additional parameter. My suggestion is to export it as a new function that the init can call if VERSION >=3.3. --

[issue13431] Pass context information into the extension module init function

2011-11-20 Thread Martin v . Löwis
Martin v. Löwis added the comment: > What about providing a function that "init" would call to get this > information, instead of a "hidden" parameter?. How would the function that init calls itself get the information, without a hidden parameter? -- title: Pass context information in

[issue13431] Pass context information into the extension module init function

2011-11-19 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: What about providing a function that "init" would call to get this information, instead of a "hidden" parameter?. -- nosy: +jcea ___ Python tracker _

[issue13431] Pass context information into the extension module init function

2011-11-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: I really do propose to close this issue as "won't fix". By the time Python 4 comes along, things will have changed a lot; it's not clear that the value of keeping it open will outweigh the cost of keeping it open. --

[issue13431] Pass context information into the extension module init function

2011-11-19 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue13431] Pass context information into the extension module init function

2011-11-19 Thread Stefan Behnel
Stefan Behnel added the comment: Yes, that's unfortunate. I found the same paragraph in section 6.5.2.2p6 of the C99 standard now, so it seems that this idea isn't suitable for the Py3.x series. There's no Python 4 target version in the bug tracker, BTW. :) -- __

[issue13431] Pass context information into the extension module init function

2011-11-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: FWIW, I think that a PEP will be needed to redesign the module initialization for Python 4. Hopefully, this time people will then identify all requirements before the PEP is accepted (which unfortunately didn't happen for PEP 3121). -- _

[issue13431] Pass context information into the extension module init function

2011-11-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: This approach is not correct C. You may pass an "incorrect" number of arguments only if the function is declared with an ellipsis, else the behavior is undefined (6.5.5.2p6). Your proposed approach works with most implementations of C, but Python shouldn't d

[issue13431] Pass context information into the extension module init function

2011-11-19 Thread Stefan Behnel
New submission from Stefan Behnel : This is a follow-up to issue 13429, which deals with setting __file__ on newly created extension modules earlier than it is currently the case. Currently, the module init function of extension modules lacks a way to find out the context in which it is being