http://codingpy.com/article/p...
?? ??:
type(a) is C` ?? isinstance(a, C)? ?????. ??? ????? ???? ??? ???? ????. ????? ??? ???? ?? ????.
閉關(guān)修行中......
?? ??? ?? ??? ?????? ?? ???? ?? isinstance
會(huì)認(rèn)為相等,type
? ???? ????.
? isinstance
比 type
多了個(gè)檢查繼承的功能,所以更愿意選擇 isinstance
? ?????.