python中,多重继承和mixin有什么区别
答案:2 悬赏:60 手机版
解决时间 2021-04-06 14:33
- 提问者网友:雪舞兮
- 2021-04-05 22:45
python中,多重继承和mixin有什么区别
最佳答案
- 五星知识达人网友:末日狂欢
- 2021-04-05 23:35
Practically, there is not different.
Mixin is implemented with multiple inheritence. Only with multiple inheritence, can we use mixin.
Mixin is a pattern like thing--so mixin objects cannot be used by themselves--they are only to add functionality to other classes.
So if you know Java, mixin is just like an interface with default implementation(and if you know Java, Java does not allow multiple inheritence)
Mixin is implemented with multiple inheritence. Only with multiple inheritence, can we use mixin.
Mixin is a pattern like thing--so mixin objects cannot be used by themselves--they are only to add functionality to other classes.
So if you know Java, mixin is just like an interface with default implementation(and if you know Java, Java does not allow multiple inheritence)
全部回答
- 1楼网友:杯酒困英雄
- 2021-04-05 23:48
我不会~~~但还是要微笑~~~:)
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯