So basically what you're saying is that there would be a more-or-less
standard wrapper for each application of function annotations.
No, I explicitly said that there may or may not arise standards based upon the existence or non-existence of community consensus and convergence of requirements. Just as there may or may not arise a standard Python web application framework depending on whether the community converges or does not.
How is
this significantly better than my dict-based approach, which uses
standardised dict keys to indicate the kind of metadata?
The dict-based approach introduces an extra namespace to manage. What if two different groups start fighting over the keyword "type" or "doc" or "lock"? Python already has a module system that allows you to use the word "type" and me to use the word "type" without conflict (though I can't guarantee that it won't be confusing!). Python's module system allows renaming and abbreviating: both valuable features.
Also, the dict-based approach is just more punctuation to type. What is the dict equivalent for:
def foo(a: type(int)) -> type(int):
...
versus
def foo(a: {"type":int}) -> {"type": int}:
In my approach you could do this:
Int = type(int)
def foo(a: Int) -> Int
Paul Prescod
_______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com