On 8/12/06, Calvin Spealman <[EMAIL PROTECTED]> wrote:
I've been looking for a good place to pipe in with the suggestion of
defining that a dictionary as an annotation is taken as a mapping of
annotation type names to the annotation itself, such as using {'doc':
"The single character argument for the command line.", 'type': int} as
an annotation for some parameter in a function.

I think we need to decide whether metadata type identifiers are just strings or whether they will typically be objects. I think that the arguments in favour of objects are strong.

However, reading through all the posts I missed recooperating from a
long trip I just returned from, I think this coupled with taking _any
iterable_ (not just list and subtypes) and the whole "your type, your
annotation" guideline, is definately sufficient for all uses.

One reason not to treat any iterable as a list of decorators is that a string is an iterable. Maybe strings won't be the only annotation that people want to attach that happens to be iterable for unrelated reasons.

A second reason that I restricted it to lists in particular is to encourage consistent syntax (rather than one person using a list, another a tuple, a third a generator, etc.).

And overall it is just overgeneralization. YAGNI. Lists work fine.

def myProtocolChainer(*args):
   return list(doSomething(args)):

It is easy to loosen the protocol in future versions if I turn out to be wrong.

 Paul Prescod

_______________________________________________
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

Reply via email to