Pythonic: Difference between revisions

4 bytes added ,  18 May 2016
m
(pyobj notes)
Line 124: Line 124:


1.  `x` stores the pointer to `d`.  The `@pyobj` ctor creates a dummy reference to `d`, this prevents GC
1.  `x` stores the pointer to `d`.  The `@pyobj` ctor creates a dummy reference to `d`, this prevents GC
2.  on deletion of x (`clear x`) we delete the dummy reference in Python.
2.  on deletion of x (`clear x`) we delete the dummy reference in Python.


Other ideas:
Other ideas:


2. Store the `repr` as a string in `x`.  This makes a copy of the object rather than a reference to the original object.
* Store the `repr` as a string in `x`.  But this makes a copy of the object rather than a reference to the original object.
99

edits