<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 29, 2017 at 7:02 AM, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 28 December 2017 at 04:22, Ethan Smith <<a href="mailto:ethan@ethanhs.me">ethan@ethanhs.me</a>> wrote:<br>
> Okay, if there is no further feedback, I will work on a singledispatchmethod<br>
> decorator like partialmethod.<br>
><br>
> For the future perhaps, would it not be possible to tell that the passed<br>
> argument is a descriptor/function and dispatch to the correct<br>
> implementation, thus not needing two functions for essentially the same<br>
> thing?<br>
><br>
> It seems more straightforward to make the implementation a bit more complex<br>
> to provide a single, simple API to users.<br>
<br>
</span>"Add 'method' to the decorator name when decorating a method" is a<br>
pretty simple rule to remember - it's much easier than "Add<br>
'arg_index=1'" (which is a comparatively arbitrary adjustment that<br>
requires a fairly in depth understanding of both the descriptor<br>
protocol and type-based function dispatch to follow).<br>
<br>
And you need the change to be explicitly opt-in *somehow*, in order to<br>
avoid breaking any existing code that relies on methods decorated with<br>
"singledispatch" dispatching on the bound class.<br></blockquote><div><br></div><div>Good points. I will start working on the singledispatchmethod implementation.</div><div><br></div><div>~>Ethan Smith<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
Cheers,<br>
Nick.<br>
<br>
--<br>
Nick Coghlan   |   <a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>   |   Brisbane, Australia<br>
</div></div></blockquote></div><br></div></div>