<div dir="ltr">On 23 May 2013 15:58, Łukasz Langa <span dir="ltr"><<a href="mailto:lukasz@langa.pl" target="_blank">lukasz@langa.pl</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 23 maj 2013, at 16:49, Guido van Rossum <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:<br>
<br>
> Łukasz, are there any open issues? Otherwise I'm ready to accept the PEP.<br>
<br>
</div>There's one. Quoting the PEP:<br>
<div class="im"><br>
"The dispatch type is currently specified as a decorator argument. The<br>
implementation could allow a form using argument annotations. This usage<br>
</div>pattern is out of scope for the standard library (per PEP 8). However,<br>
<div class="im">whether this registration form would be acceptable for general usage, is<br>
up to debate."<br>
<br>
</div>I feel that the PEP should explicitly allow or disallow for the<br>
implementation to accept dispatch on annotations, e.g.:<br>
<br>
@func.register<br>
def _(arg: int):<br>
  ...<br>
<br>
versus<br>
<br>
@func.register(int)<br>
def _(arg):<br>
  ...</blockquote><div><br></div><div style>Personally, I think the register(int) form seems more natural. But that may well be because there are no uses of annotations in the wild (at least not in code I'm familiar with) and having this as an example of how annotations can be used would help with adoption.</div>
<div style><br></div><div style>I'm not 100% sure what the options are.</div><div style><br></div><div style>1. Only support the register(int) form</div><div style>2. Only support the annotation form</div><div style>3. Support both annotation and argument forms</div>
<div style><br></div><div style>Is the debate between 1 and 2, or 1 and 3? Is it even possible to implement 3 without having 2 different names for "register"?</div><div style><br></div><div style>If the debate is between 1 and 2, I'd prefer 1. But if it's between 1 and 3, I'm less sure - having the *option* to try annotations for this in my own code sounds useful.</div>
<div style><br></div><div style>Paul.</div></div></div></div>