473,320 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

PyList_New

Hi everybody,

Does PyList_New() increments the reference count? I believe yes but I
want to be sure because I saw some code from a module that has a
function that increments it before returning the list.

Thanks in advance,
soso
Jul 18 '05 #1
1 4083
[soso]
Hi everybody,
Hello!

Does PyList_New() increments the reference count?
Yes.

I believe yes but I
want to be sure because I saw some code from a module that has a
function that increments it before returning the list.
Quoth the docs:
"""
PyObject* PyList_New( int len)

Return value: New reference.
Returns a new list of length len on success, or NULL on failure.
"""

Thanks in advance,
You're welcome after the fact.

soso

Raymond Hettinger
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: William Hanlon | last post by:
Hi, I would like to use the Python C API to use python to access functions originally written in C. The objects that I would like to pass to python have multi-dimensional arrays. How do I...
5
by: Mike S. | last post by:
Hello, Has anyone had success compiling the informixdb-1.3 module under python 2.2? It seems the absense of makefile.pre.in in python 2.2 causes the break under py2.2. Is there an easy way...
1
by: John Hunter | last post by:
I am writing a python extension module and have a reference counting question My function looks like static PyObject * pokereval_seven_cards(PyObject *self, PyObject *args) { int i;
1
by: Chun-Chieh Huang | last post by:
Dear all, I carefully lookup PyObject_Print in the API manual, but I can't find the resolution. And the problem is described below: I embed python into C++ code as follows: // First...
4
by: Nick Jacobson | last post by:
In the Python Cookbook, Luther Blisset wrote a very useful class with the Python C API. It takes a Python list of elements and copies it member by member into a C array. Here it is, (slightly...
3
by: Matjaz | last post by:
Dear all, I have run into a problem using python lists and sequence protocol. The first code snippet uses explicit list operations and works fine. PyObject *argseq, *ov; int i, v, len; ...
0
by: Adam McCarthy | last post by:
I'm trying to get a cross compiler working for arm-wince-pe. This is the output for the primes Pyrex example. If I compile simple Hello, World's etc, it works fine, but for some reason Python...
3
by: rimmer | last post by:
I'm writing an extension module in C in which I'm passing an array of floats from C to python. The code below illustrates a simple C function designed to output an array of floats. ---------...
1
by: cody314 | last post by:
Versions: Python 2.5.1 (r251:54863, May 14 2007, 10:50:04) SWIG Version 1.3.20 Hello I have some code that wraps a C++ library so I may use it in python. The code basically just gets some data...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.