Inherit from array

TG girodt at gmail.com
Wed Apr 26 09:52:37 EDT 2006


from array import array
class Vector(array):
    def __init__(self,size):
        print "pouet"
        array.__init__('f')
        print "pouet"

v = Vector('c')
print repr(v)

will output :

pouet
pouet
array('c')




More information about the Python-list mailing list