Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18761 > unrolled thread

Re: C-API: Pass a tuple to a method of a class

Started byStefan Behnel <stefan_ml@behnel.de>
First post2012-01-10 15:05 +0100
Last post2012-01-10 15:05 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: C-API: Pass a tuple to a method of a class Stefan Behnel <stefan_ml@behnel.de> - 2012-01-10 15:05 +0100

#18761 — Re: C-API: Pass a tuple to a method of a class

FromStefan Behnel <stefan_ml@behnel.de>
Date2012-01-10 15:05 +0100
SubjectRe: C-API: Pass a tuple to a method of a class
Message-ID<mailman.4596.1326204337.27778.python-list@python.org>
[cleaned up top-posted citation order to make the replies readable]

刘振海, 10.01.2012 14:24:
> 2012/1/10 Stefan Behnel
>> """
>> # in module "gluecode.pyx" (or whatever you want to name it)
>>
>> import mModule8
>>
>> cdef api float compute_norm(float init_value, float x, float y, float z):
>>    vec = mModule8.cVector(init_value)
>>    return vec.ComputeNorm( (x,y,z) )
>> """

I just noticed that this swallows exceptions. It should have one of the
"except" declarations at the end of the signature to enable proper
exception signalling to the calling C/C++ code.

http://docs.cython.org/src/userguide/language_basics.html#error-return-values


> I have been using Cython for a period of time. But I can not find a
> description for the "api" key word in Cython documents

I admit that searching for "api" isn't really helpful here, but at least
the page on "interfacing with external C code" shouldn't be all that hard
to find in the given context. It contains this section:

http://docs.cython.org/src/userguide/external_C_code.html#using-cython-declarations-from-c

Stefan

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web