forget about it, I was misreading your code (getattr instead of hasattr, should be fine).