Encapsulating data in Python