python --int 对象

1.int对象的定义: typedef struct { PyObject_HEAD //所有对象都包含的对象头信息。 long ob_ival; //long类型 } PyIntObject;

Pyint_Type: PyTypeObject PyInt_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "int", sizeof(PyIntObject), 0, (destructor)int_dealloc, /* tp_dealloc / (printfunc)int_print, / tp_print / 0, / tp_getattr / 0, / tp_setattr / (cmpfunc)int_compare, / tp_compare / (reprfunc)int_to_decimal_string, / tp_repr / &int_as_number, / tp_as_number / 0, / tp_as_sequence / 0, / tp_as_mapping / (hashfunc)int_hash, / tp_hash / 0, / tp_call / (reprfunc)int_to_decimal_string, / tp_str / PyObject_GenericGetAttr, / tp_getattro / 0, / tp_setattro / 0, / tp_as_buffer / Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_INT_SUBCLASS, / tp_flags / int_doc, / tp_doc / 0, / tp_traverse / 0, / tp_clear / 0, / tp_richcompare / 0, / tp_weaklistoffset / 0, / tp_iter / 0, / tp_iternext / int_methods, / tp_methods / 0, / tp_members / int_getset, / tp_getset / 0, / tp_base / 0, / tp_dict / 0, / tp_descr_get / 0, / tp_descr_set / 0, / tp_dictoffset / 0, / tp_init / 0, / tp_alloc / int_new, / tp_new / (freefunc)int_free, / tp_free */ };


初始化 int _PyInt_Init(void) {​

int_compare:

输入图片说明

转载于:https://my.oschina.net/tplinuxhyh/blog/681161

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值