How to implement C++ equivalent of templates

Learn Python learnpython at hotmail.com
Sat Aug 18 01:39:17 EDT 2001


Was trying to write my vector.
Am not able to write a class which encloses a list and control access to the 
list through __setitem__ and __getitem__ because

isinstance() expects a class name as the argument and not a string 
representation of the class. So am not able to verify the actual class name 
@ runtime in the __setitem__ method

i thougt i c'd allow the user to configure the class instances
he wants to hold in the MyVector class __init__.

can someone show tell me how this can be done?

thanks in advance
karthik.

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp





More information about the Python-list mailing list