[Tutor] Why use apply()?

Bernard Lebel 3dbernard at gmail.com
Thu May 12 23:17:31 CEST 2005


Just a generic question: why one would use apply()?

In Learning Python, on page 357, there is an example of generating an
instance using apply():

class A:
      def __init__( self, number ):
             self.number = number

a = apply( A, 3 )



What is the benefit of doing this over simply creating an instance
"the usual way":


a = A( 3 )



Thanks
Bernard


More information about the Tutor mailing list