John A Meinel wrote:
> ^- PyTuple_SET_ITEM doesn't INCREF, it 'steals' a reference. This is ok
> for 'as_tuple' because you are transferring ownership from
> StaticTuple_as_tuple. However it is not ok for StaticTuple_Type. So you
> just need to add
>
> Py_INCREF(&StaticTuple_Type)
>
> I think it would probably also be good to test that pickling a nested
> StaticTuple works, but otherwise this looks good to me. (as long as we
> add the one Py_INCREF call.)
Done and done. Thank you! :-)
I thought the test was getting a little unwieldy, so I split it up into
3 methods. I hope you don't mind.
John A Meinel wrote: as_tuple. However it is not ok for StaticTuple_Type. So you &StaticTuple_ Type)
> ^- PyTuple_SET_ITEM doesn't INCREF, it 'steals' a reference. This is ok
> for 'as_tuple' because you are transferring ownership from
> StaticTuple_
> just need to add
>
> Py_INCREF(
>
> I think it would probably also be good to test that pickling a nested
> StaticTuple works, but otherwise this looks good to me. (as long as we
> add the one Py_INCREF call.)
Done and done. Thank you! :-)
I thought the test was getting a little unwieldy, so I split it up into
3 methods. I hope you don't mind.
Incremental diff:
<http:// bzr.mattnordhof f.com/loggerhea d/bzr/statictup le-pickling/ revision/ 4779>
--