Implement gc methods (traverse, clear) for immutable objects #5694
-
|
Hi, I have a use case where a frozen object need to store a reference to a Python objects (Option<HashMap<String, Py>>). Because I store a Python object, I believe I should implement the equivalent of tp_traverse and tp_clear. However since the object is frozen I cannot get a mutable reference and hence implement clear. Is this a case where one can skip those implementation and if not how can I implement clear ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
You can skip |
Beta Was this translation helpful? Give feedback.
You can skip
tp_clearon immutable objects. (Presumably to create a cycle, some other part of the chain must be mutable, and that part should implementtp_clear.)