Skip to main content

More Abstraction

  • Chapter
  • First Online:
Book cover Beginning Python
  • 20k Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Note that these objects need to support addition with each other. So calling add(1, 'license') would not work.

  2. 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

Authors

Rights and permissions

Reprints 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

Publish with us

Policies and ethics