日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側工具欄

新聞中心

這里有您想知道的互聯(lián)網營銷解決方案
創(chuàng)新互聯(lián)Python教程:弱引用對象

弱引用對象

python 支持 “弱引用” 作為一類對象。具體來說,有兩種直接實現(xiàn)弱引用的對象。第一種就是簡單的引用對象,第二種盡可能地作用為一個原對象的代理。

創(chuàng)新互聯(lián)主營晉中網站建設的網絡公司,主營網站建設方案,重慶APP開發(fā),晉中h5成都微信小程序搭建,晉中網站營銷推廣歡迎晉中等地區(qū)企業(yè)咨詢

int PyWeakref_Check(ob)

如果 ob 是一個引用或代理對象則返回真值。 此函數總是會成功執(zhí)行。

int PyWeakref_CheckRef(ob)

如果 ob 是一個引用對象則返回真值。 此函數總是會成功執(zhí)行。

int PyWeakref_CheckProxy(ob)

如果 ob 是一個代理對象則返回真值。 此函數總是會成功執(zhí)行。

PyObject *PyWeakref_NewRef(PyObject *ob, PyObject *callback)

Return value: New reference. Part of the Stable ABI.

Return a weak reference object for the object ob. This will always return a new reference, but is not guaranteed to create a new object; an existing reference object may be returned. The second parameter, callback, can be a callable object that receives notification when ob is garbage collected; it should accept a single parameter, which will be the weak reference object itself. callback may also be None or NULL. If ob is not a weakly referencable object, or if callback is not callable, None, or NULL, this will return NULL and raise TypeError.

PyObject *PyWeakref_NewProxy(PyObject *ob, PyObject *callback)

Return value: New reference. Part of the Stable ABI.

Return a weak reference proxy object for the object ob. This will always return a new reference, but is not guaranteed to create a new object; an existing proxy object may be returned. The second parameter, callback, can be a callable object that receives notification when ob is garbage collected; it should accept a single parameter, which will be the weak reference object itself. callback may also be None or NULL. If ob is not a weakly referencable object, or if callback is not callable, None, or NULL, this will return NULL and raise TypeError.

PyObject *PyWeakref_GetObject(PyObject *ref)

Return value: Borrowed reference. Part of the Stable ABI.

返回弱引用對象 ref 的被引用對象。如果被引用對象不再存在,則返回 Py_None。

備注

該函數返回被引用對象的一個 borrowed reference。 這意味著應該總是在該對象上調用 Py_INCREF(),除非是當它在借入引用的最后一次被使用之前無法被銷毀的時候。

PyObject *PyWeakref_GET_OBJECT(PyObject *ref)

Return value: Borrowed reference.

Similar to PyWeakref_GetObject(), but does no error checking.


當前標題:創(chuàng)新互聯(lián)Python教程:弱引用對象
新聞來源:http://m.5511xx.com/article/cohcgjh.html