Antoine Pitrou <pit...@free.fr> added the comment:

Comments:

- the tests look fragile. How can you know a garbage collection will only 
collect your own objects? So you should call gc.collect() first at the 
beginning of each test and then initialize the self.visit list. We don't want 
weird failures because of the unittest machinery or anything else.

- I also don't understand the logic in testCollect. Why can't you directly 
check the contents of self.visit instead of that convoluted code?

- In invoke_gc_callback(), "i" should be a Py_ssize_t, not an int

- In invoke_gc_callback(), in which situation can callbacks be something else 
than a list? I think the PyList_Check() should be an assert (and probably use 
PyList_CheckExact()).

- Finally, *please* try to follow PEP 8. Comments should have a space after the 
"#". Otherwise they look unreadable.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10576>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to