-2
我在Python C API中發現了一個奇怪的情況。Python C API:如何評估布爾值的自定義對象?
我有一個自定義的python對象,當它用bool內建函數計算時,他的返回值是False。
如何使自定義對象的類型評估爲True?
我注意到這個問題,當我嘗試評估函數(代表一個功能的自定義對象)如下:
if cutomobject: # False! But the object is a valid reference.
The thread module makes this check, and this prevents me of execute thread