Person類,怎么會出現Animal實例的地址?
class?Person: ????pass bob?=?Person() str(bob)?#?==>?'<__main__.Person?object?at?0x7fc77b859c50>'
<__main__.Person object at 0x7fc77b859c50>這個結果其實是Animal的實例cat在內存中的地址,這是相當難以理解的,
確實是難以理解
class?Person: ????pass bob?=?Person() str(bob)?#?==>?'<__main__.Person?object?at?0x7fc77b859c50>'
<__main__.Person object at 0x7fc77b859c50>這個結果其實是Animal的實例cat在內存中的地址,這是相當難以理解的,
確實是難以理解
2022-01-08
舉報
2022-01-08
是4.2節的問題。