Re: [Python-Dev] [Python-3000] PyString -> PyBytes C API renaming

Stefan Behnel wrote:
M.-A. Lemburg wrote:
If you use PyBytes APIs, you expect to find PyBytes functions in the libs and also set breakpoints on these.
AFAICT, the PyBytes_* functions are in both Py2.6 and Py3 now, so no problem here.
The PyBytes_* functions appear to be there, but a preprocessor macro means it is actually the PyString_* functions that appear in the Python DLL. That's great from a backwards compatibility point of view, but seriously confusing from the point of view of anyone trying to embed or otherwise debug Python 2.6.
Besides, how likely is it that users set a breakpoint on the PyBytes/PyString functions?
Not very likely at all - but it would still be nice if the PyBytes_* symbols were visible to the linker as well as the preprocessor. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org

2008/5/29 Nick Coghlan <ncoghlan@gmail.com>:
it would still be nice if the PyBytes_* symbols were visible to the linker as well as the preprocessor.
If this is not a strict requirement but a useful extra, then it might be done in an unportable way. GCC has an 'alias' attribute: http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html -- Marcin Kowalczyk qrczak@knm.org.pl http://qrnik.knm.org.pl/~qrczak/

Nick Coghlan wrote:
Stefan Behnel wrote:
Besides, how likely is it that users set a breakpoint on the PyBytes/PyString functions?
Not very likely at all - but it would still be nice if the PyBytes_* symbols were visible to the linker as well as the preprocessor.
Right, that's a nice-to-have, an add-on. Why don't we just let Christian finish his work, which is vital for the beta release? Then it's still time to file a bug report on the missing bits and provide a patch that adds linker symbols for PyBytes_*() in Py2.6 as an additional feature. Stefan

Stefan Behnel wrote:
Nick Coghlan wrote:
Stefan Behnel wrote:
Besides, how likely is it that users set a breakpoint on the PyBytes/PyString functions? Not very likely at all - but it would still be nice if the PyBytes_* symbols were visible to the linker as well as the preprocessor.
Right, that's a nice-to-have, an add-on. Why don't we just let Christian finish his work, which is vital for the beta release? Then it's still time to file a bug report on the missing bits and provide a patch that adds linker symbols for PyBytes_*() in Py2.6 as an additional feature.
Yeah, it took me a while to get my head around what he was trying to do, but GPS explained it pretty well elsewhere in this thread. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org
participants (3)
-
Marcin ‘Qrczak’ Kowalczyk
-
Nick Coghlan
-
Stefan Behnel