Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
def f(x,y) :
    return x if y>0 else -x

list = map(f, arrX, arrY)

 

Constructor, destructor etc.

Code Block
class PeakListFile :
    def __init__(self, fname) :
	    print 'constructor'
        self.f=open(fname,'r')

    def __del__(self) :
	    print 'destructor'
        try :
            self.f.close()

    def __call__(self) :
	    print 'this is a default method of this object called as obj()'

 

Polymorphism

Derived class initialization

...