擅长:python、mysql、java
<p>在未合并错误修复程序的情况下,一种解决方法是修补<a href="https://docs.python.org/3/library/functools.html#functools.singledispatchmethod" rel="nofollow noreferrer">^{<cd1>}</a><code>.register()</code>:</p>
<pre class="lang-py prettyprint-override"><code>from functools import singledispatchmethod
def _register(self, cls, method=None):
if hasattr(cls, '__func__'):
setattr(cls, '__annotations__', cls.__func__.__annotations__)
return self.dispatcher.register(cls, func=method)
singledispatchmethod.register = _register
</code></pre>