with_custodian_and_ward

Registered by Gustavo Carneiro

It seems there is some demand for a with_custodian_and_ward "call policy" like what is implemented by boost::python:

http://www.boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.call_policies
http://www.boost.org/libs/python/doc/v2/reference.html#models_of_call_policies

Possible design:
  The "custodian" object needs to have GC support enabled. The instance structure receives a PyList object that keeps track of wards. This list is deallocated when the custodian is freed, thereby freeing the wards. The list is Py_VISIT'ed in the tp_traverse method, to ensure reference cycles are properly collected. 'ward' Parameter's or ReturnValue's are modified to generate code that appends themselves to the list stored in the custodian.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
Gustavo Carneiro
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Gustavo Carneiro
Completed by
Gustavo Carneiro

Related branches

Sprints

Whiteboard

Implemented.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.