> The problem is that when we jump into the epilogue, a 'line' trace > event gets generated before the 'return' one. So there is no > --Return-- hint. Ah, I missed that detail in your transcript. > 1) Don't you find the idea of type(co.co_code) == types.ArrayType at > least a little scary? Mainly due to resizes -- having mutable code > might be nice for development environments and such. Yes, it's scary. But nobody does this, and as you say, it can't be done from Python. > 2) I thought it was possible for bf_getreadbuffer to fail (maybe I'm > wrong here). _PyCode_GETCODEPTR does no error checking. So one should only use objects whose bf_getreadbuffer won't fail (when invoked with segment index 0). > > I'd be happy to kill it as a YAGNI. > > That's nice, but if... > > > But that still doesn't mean I approve checking for "4 bytes from the > > end". > > ...it doesn't actually help. Well, it kills off a potentially unsafe feature. > Does anyone have any better ideas for not generating 'line' trace > events in the epilogue? Use a separate opcode for which you could check? --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4