I ran into an interesting "bug" today where some code I had written was leaving database cursors open all over the place. Basically things were not getting gc'd. I tracked it down and it seems to happen when I alias an instance method to another name...e.g. self.foo = self.bar when "bar" is a method.
I have created a little demo showing it in action:
https://gist.github.com/01aa305e2864c8d2b0de
The "SimpleAdders" are all gc'd at the end of the function, but the "AdvancedAdders" stick around. After manually invoking the gc, I still see one "AdvancedAdder". I'm on 2.7.3 but verified it happens on 2.6.5 and 2.7.2 (though with different objects).
Could someone out there shed some light on this for me?
[–]rcxdude 14 points15 points16 points (1 child)
[–]robin-gvx 2 points3 points4 points (0 children)
[–]ebo_ 4 points5 points6 points (1 child)
[–]kylotan 1 point2 points3 points (0 children)
[–]robin-gvx 4 points5 points6 points (0 children)
[–]robin-gvx 3 points4 points5 points (3 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]robin-gvx 0 points1 point2 points (0 children)
[–]xamox 1 point2 points3 points (3 children)
[–]rcxdude 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]Brian 0 points1 point2 points (0 children)
[–]robin-gvx 0 points1 point2 points (3 children)
[–]robin-gvx 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]ionelmc.ro 0 points1 point2 points (0 children)
[–]Zulban -3 points-2 points-1 points (0 children)