


#強制使用浮點數,

typing可以使用Union
但dispatch不行,
會出現TypeError
Traceback (most recent call last):
File “c:\Python\RF Stable\untitled0.py”, line 7, in <module>
def myFunc(a: Union[float, int], b: Union[float, int]) -> Union[float, int]:
File “C:\ProgramData\Anaconda\lib\site-packages\multipledispatch\core.py”, line 68, in _
dispatcher.add(types, func)
File “C:\ProgramData\Anaconda\lib\site-packages\multipledispatch\dispatcher.py”, line 222, in add
raise TypeError(“Tried to dispatch on non-type: %s\n”
TypeError: Tried to dispatch on non-type: typing.Union[float, int]
In signature: <typing.Union[float, int], typing.Union[float, int]>
In function: myFunc

![Python: 字串 str.find(關鍵字[,start][,end]),找不到的話回傳-1,如何找出資料字串中,所有關鍵字的index?詞頻計算 Python: 字串 str.find(關鍵字[,start][,end]),找不到的話回傳-1,如何找出資料字串中,所有關鍵字的index?詞頻計算](https://i1.wp.com/savingking.com.tw/wp-content/uploads/2022/11/20221122100657_32.png?quality=90&zoom=2&ssl=1&resize=350%2C233)




![別把中文洗掉:Python `isalnum()` vs `[^A-Za-z0-9]` 含/不含 CJK中日韓 別把中文洗掉:Python `isalnum()` vs `[^A-Za-z0-9]` 含/不含 CJK中日韓](https://i1.wp.com/savingking.com.tw/wp-content/uploads/2026/05/20260525082752_0_4776cd.png?quality=90&zoom=2&ssl=1&resize=350%2C233)




近期留言