Added some code snippets found after groping around with winpdb.