[C++-sig] How to use functionality of list.

vishal bayskar vishal.bayskar at nechclst.in
Wed May 5 14:40:52 CEST 2010


>Both indexing suites provides interface very similar to Python
>containers. So the user will not have to learn new API, but if you
>insists, you can rename/introduce new method from Python

>AList.push_back = AList.append

But object Alist is not treated as a list and giving the below error.

>>> dummyList =testModule.getDummyAlist()
>>>
>>> print dummyList
<testModule.Alist object at 0x2aaaaab3e848>
>>>
>>> aobj=testModule.A(5)
>>>
>>> print aobj
<testModule.A object at 0x2aaaaab3c680>
>>>
>>> dummyList.append(aobj)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: 'Alist' object has no attribute 'append'



-- 
View this message in context: http://old.nabble.com/How-to-use-functionality-of-list.-tp28459066p28460323.html
Sent from the Python - c++-sig mailing list archive at Nabble.com.



More information about the Cplusplus-sig mailing list