On 5/19/06, Jim Jewett <[EMAIL PROTECTED]> wrote: > On 5/19/06, Collin Winter <[EMAIL PROTECTED]> wrote: > > On 5/19/06, Jim Jewett <[EMAIL PROTECTED]> wrote: > > > (1) Just use a tuple, and put the smarts in your decorator if you > > > need to actually do something with the information. > > > > @decorator_which_handles_tuples > > > def f(a: (int, str)): > > > How do you differentiate between this and wanting to assert that 'a' > > is a 2-tuple with a first element of type int and a second element of > > type str? > > The decorator knows. The human only knows by convention. (But that's > true anyhow; a sneaky decorator could replace the entire function with > something having an unrelated signature.) > > I expect that there would be other decorators using a tuple to say > "must meet all", rather than "must meet at least one".
And what if I want to use several decorators at the same time, all of which stake a claim to tuples? Collin Winter _______________________________________________ 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
