use*_*011 -1 python
我试图修改Python中'int'类型的行为.
它说
'__new__' is readonly.
有办法吗?
谢谢.
Sve*_*ach 5
您无法修改内置类型,但可以从中派生:
class MyInt(int): def __new__(cls, *args): # whatever
归档时间:
13 年,8 月 前
查看次数:
78 次
最近记录: