By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,855 Members | 1,838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,855 IT Pros & Developers. It's quick & easy.

Passing list with flexible length to C extension

P: n/a
Is there a way to pass list with flexible length to C extension?
I want to pass flexible length list of floats to method and just can't get info
if it is possible and how to do it.

Thanks,

B.

Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Boštjan Jerko <bo***********@mf.uni-lj.si> writes:
Is there a way to pass list with flexible length to C extension?


Yes, although I'm not quite sure what you mean. Do you want to be
able to type

my_ext_func([3.0, 1.0, 4.0, 1.0, 5.0])

or

my_ext_func(3.0, 1.0, 4.0, 1.0, 5.0)

? If the latter you can't use PyArg_ParseTuple, but the `args'
parameter is just a tuple, amenable to PyTuple_Length & so on.

Cheers,
mwh

--
Our Constitution never promised us a good or efficient government,
just a representative one. And that's what we got.
-- http://www.advogato.org/person/mrorg...html?start=109
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.