On Fri, 19 Oct 2007 12:21:25 -0400, Colin J. Williams wrote: > In this case, why do we continue to use the word class to generate a > type?
Because type is a callable, and class is convenient syntactic sugar. class Parrot(object): def speak(self, msg): return "Polly sez %s" % msg is much more convenient than: import new Parrot = type('Parrot', (object,), {'speak': lambda self, msg: 'Polly sez %s' % msg}) particularly for large classes with many methods. -- Steven -- http://mail.python.org/mailman/listinfo/python-list