Chris Kaynor, 01.11.2011 17:19:
On Tue, Nov 1, 2011 at 8:57 AM, Stefan Behnel wrote:
Chris Kaynor, 31.10.2011 19:34:
I am currently rewritting a class using the Python C API to improve
performance of it, however I have not been able to find any
documentation about how to make a context manager
On Tue, Nov 1, 2011 at 8:57 AM, Stefan Behnel wrote:
> Chris Kaynor, 31.10.2011 19:34:
>>
>> I am currently rewritting a class using the Python C API to improve
>> performance of it, however I have not been able to find any
>> documentation about how to make a context manager using the C API.
>
>
Chris Kaynor, 31.10.2011 19:34:
I am currently rewritting a class using the Python C API to improve
performance of it, however I have not been able to find any
documentation about how to make a context manager using the C API.
You should take a look at Cython. It makes these things *so* much ea
On Mon, Oct 31, 2011 at 12:15 PM, Brian Curtin wrote:
>
> You'd just add "__enter__" and "__exit__" in the PyMethodDef. If you
> have the CPython source, we do it in there in a few places. Off the
> top of my head, PC\winreg.c contains at least one class that works as
> a context manager (PyHKEY),
On Mon, Oct 31, 2011 at 13:34, Chris Kaynor wrote:
> I am currently rewritting a class using the Python C API to improve
> performance of it, however I have not been able to find any
> documentation about how to make a context manager using the C API.
>
> The code I am working to produce is the fo
I am currently rewritting a class using the Python C API to improve
performance of it, however I have not been able to find any
documentation about how to make a context manager using the C API.
The code I am working to produce is the following (its a method of a class):
@contextlib.contextmanage