<div dir="ltr"><div><div><div><div>Okay, if there is no further feedback, I will work on a singledispatchmethod decorator like partialmethod.<br><br></div>For the future perhaps, would it not be possible to tell that the passed argument is a descriptor/function and dispatch to the correct implementation, thus not needing two functions for essentially the same thing?<br><br></div>It seems more straightforward to make the implementation a bit more complex to provide a single, simple API to users.<br><br></div>Cheers,<br><br></div>Ethan<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 26, 2017 at 3:29 PM, Ivan Levkivskyi <span dir="ltr"><<a href="mailto:levkivskyi@gmail.com" target="_blank">levkivskyi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On 26 December 2017 at 01:41, 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>On 25 December 2017 at 12:32, Ethan Smith <<a href="mailto:ethan@ethanhs.me" target="_blank">ethan@ethanhs.me</a>> wrote:<br>
> So at the moment, I don't think it is possible to implement singledispatch<br>
> on classmethod or staticmethod decorated functions.<br>
<br>
</span>I've posted this to the PR, but adding it here as well: I think this<br>
is a situation very similar to the case with functools.partialmethod,<br>
where you're going to need to write a separate<br>
functools.singledispatchmethod class that's aware of the descriptor<br>
protocol, rather than trying to add the functionality directly to<br>
functools.singledispatch.<br></blockquote><div><br></div></span><div>I agree with Nick here. Adding a separate decorator looks like the right approach,</div><div>especially taking into account the precedent of @partialmethod.</div><div><br></div><div>--</div><div>Ivan</div><div><br></div><div><br></div></div></div></div>
</blockquote></div><br></div>