Why __str__ method of custom dictionary subclass is not returning {} as expected