On 5/2/06, Jim Jewett <[EMAIL PROTECTED]> wrote: > On 5/1/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > >... I'm settled on the following syntax for adding optional annotations > > > def foo(arg1name: typeexpr = defaultexpr, arg2: typeexpr = > > defaultexpr, ...): ... > > Did you also decide that the annotations will have no effect by > themselves, and will rely on, for example, a decorator?...
Right. It doesn't have to be a decorator though -- it could be some other kind of introspection. > > lambda arg1name : ... > > If something is worth decorating, it is worth naming. > > If you even need to *document* restrictions on the argument (beyond > what you can get easily from the name or context), then the function > is a little too fancy for a lambda. Depends on what you use the annotations for. If you have a framework that uses annotations to guide some kidn of adaptation machinery, I could imagine a use for a lambda with an annotation. But I'll happily say YAGNI... -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
