Update object.py

Improved class hierarchy