<br><br><div><span class="gmail_quote">On 8/15/06, <b class="gmail_sendername">Collin Winter</b> &lt;<a href="mailto:collinw@gmail.com">collinw@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 8/15/06, Paul Prescod &lt;<a href="mailto:paul@prescod.net">paul@prescod.net</a>&gt; wrote:<br>&gt; I totally do not understand the requirement for the dictionary and its extra<br>&gt; overhead.<br><br>Under your proposal, annotation consumer libraries have to provide
<br>wrappers for Python's built-in types, since the only way a library has<br>of knowing whether it should process a given object is by applying a<br>subclass test.<br><br>Extending this same idea to static analysis tools, tools like
<br>pychecker or an optimising compiler would have to supply their own<br>such wrapper classes. This would be a huge burden, not just on the<br>authors of such tools, but also on those wishing to use these tools.</blockquote>
<div><br>No, this is incorrect. Metadata is just metadata. Libraries act on metadata.&nbsp; There is a many to many relationship. You could go and define Collin's type metadata syntax. You create a library of wrappers (really you need only ONE wrapper). Then you could convince the writers of PyPy to use the same syntax. So there would be one set of annotations used by two libraries.
<br><br>Here's what the definition of the one wrapper could look like:<br><br>class my_type:<br>&nbsp;&nbsp; def __init__(self, data):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.data = data<br><br>That's it. That's all you need to implement.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I want people to be able to use Python's built-in types without ugly<br>wrapper classes or any other similar impediments to their pre-existing<br>Python workflow/thought patterns.</blockquote><div><br>The wrapper class doesn't need to be ugly. Just:
<br><br>from typecheck import my_type as t<br><br>def foo(a: t(int, int), b: t(&quot;abc&quot;)): ...<br><br>&nbsp;Paul Prescod<br><br></div><br></div>