就是根据值,来分派。有可能实现吗
比如值是 1,或 2 这样
1
leishi1313 2019 年 7 月 9 日 via Android
let me google that for you
https://lmgtfy.com/?q=Singledispatch+based+on+value+instead+of+type |
2
princelai 2019 年 7 月 9 日
好像没有这样的装饰器或方法吧,自己写个函数,内部 if else 判断下?
|
4
goofool 2019 年 7 月 9 日
定义自己的 int 类
|