Abstract
In the previous chapters, you looked at Python’s main built-in object types (numbers, strings, lists, tuples, and dictionaries); you peeked at the wealth of built-in functions and standard libraries; and you even created your own functions. Now, only one thing seems to be missing—making your own objects. And that’s what you do in this chapter.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Note that these objects need to support addition with each other. So calling add(1, 'license') would not work.
- 2.
Some languages support several degrees of privacy for its member variables (attributes). Java, for example, has four different levels. Python doesn’t really have equivalent privacy support, although single and double initial underscores do to some extent give you two levels of privacy.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2017 Magnus Lie Hetland
About this chapter
Cite this chapter
Hetland, M.L. (2017). More Abstraction. In: Beginning Python. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0028-5_7
Download citation
DOI: https://doi.org/10.1007/978-1-4842-0028-5_7
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-0029-2
Online ISBN: 978-1-4842-0028-5
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)