On Thu, Jan 5, 2017 at 11:28 PM, Hans-Peter Jansen <hpj at urpla.net> wrote: > Leaves the question, how stable this "interface" is? > Accessing _objects here belongs to voodoo programming practices of course, but > the magic is locally limited to just two lines of code, which is acceptable in > order to get this context manager working without messing with the rest of the > code. My intent was not to suggest that anyone directly use the _objects value / dict in production code. It's a private implementation detail. I was demonstrating the problem of simply releasing the buffer and the large number of checks that would be required if b_ptr is cleared. It would be simpler for a release() method to allocate new memory for the object and set the b_needsfree flag, but this may hide bugs. Operating on a released object should raise an exception.
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