On Fri, 31 Dec 2004 22:09:49 -0500, Terry Reedy <[EMAIL PROTECTED]> wrote: > > "Adam DePrince" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > In sort, we must preserve the ability to create an anonymous function > > simply because we can do so for every other object type, and functions > > are not special enough to permit this special case. > > Please show me how to create an anonymous type, module, or class, > especially with an expression. Number, sequences, and dicts have easily > printable values. Functions, like classes and module do not*, so > definition names act as a standin and as a pointer to the source code that > produced the object. If functions are not special relative to classes and > modules, which is the grouping they belong with, then we should get rid of > lambda ;-)
>>> print type('<anon>', (object,), {'foo': lambda self: 'spam'})().foo() spam Jp -- http://mail.python.org/mailman/listinfo/python-list