Issue 57 in tinypy: Is __del__ supported? Is garbage collection working?

152 views
Skip to first unread message

codesite...@google.com

unread,
Feb 18, 2013, 2:23:04 AM2/18/13
to tin...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 57 by paulhaeb...@gmail.com: Is __del__ supported? Is garbage
collection working?
http://code.google.com/p/tinypy/issues/detail?id=57

tinypy is amazing. Very nice to see such a concise implementation
of python!

What steps will reproduce the problem?

1. try to run this code:

ndel = 0

class rect:
def __init__(self, orgx, orgy, sizex, sizey):
self.orgx = orgx
self.orgy = orgy
self.sizex = sizex
self.sizey = sizey
self.list = [];
for i in range(10):
self.list.append(i)

def __del__(self):
print("del")
ndel = ndel + 1

for i in range(1000):
a = rect(0,0,100,100)
b = rect(0,0,100,100)
b = a

print("__del__ called " + str(ndel) + " times")
print("bye")

What is the expected output? What do you see instead?

I was expecting __del__ to be called like in cpython. Is garbage collection
working? I added printf to gc.c and it shows these functions being called,
but the __del__ function is not being called.

running tp_follow
running tp_follow
running tp_follow
running tp_full
running tp_follow
running tp_collect
running tp_follow
running tp_follow

What version of the product are you using? On what operating system?

tinypy 1.1 OSX 10.7.5

Please provide any additional information below.

See the attached file del.py



Attachments:
del.py 482 bytes

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

codesite...@google.com

unread,
Feb 18, 2013, 2:18:23 PM2/18/13
to tin...@googlegroups.com

Comment #1 on issue 57 by paulhaeb...@gmail.com: Is __del__ supported? Is
After adding some printfs it looks like garbabge collection is happening
fine, the problem is that __del__ is not being called. Maybe if I study
the source I can make it work...
Reply all
Reply to author
Forward
0 new messages