Python 3 Object Oriented Programming

If you feel it’s time you learned object-oriented programming techniques, this is the perfect book for you. Clearly written with practical exercises, it’s the painless way to learn how to harness the power of OOP in Python.

Python 3 Object Oriented Programming

Dusty Phillips

2 customer reviews
If you feel it’s time you learned object-oriented programming techniques, this is the perfect book for you. Clearly written with practical exercises, it’s the painless way to learn how to harness the power of OOP in Python.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$21.00
RRP $29.99
Save 29%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$21.00
$49.99
$29.99p/m after trial
RRP $29.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781849511261
Paperback404 pages

Book Description

Object Oriented Programming is a very important aspect of modern programming languages. The basic principles of Object Oriented Programming are relatively easy to learn. Putting them together into working designs can be challenging.

This book makes programming more of a pleasure than a chore using powerful Python 3 object-oriented features of Python 3. It clearly demonstrates the core OOP principles and how to correctly implement OOP in Python.

Object Oriented Programming ranks high in importance among the many models Python supports. Yet, many programmers never bother learning the powerful features that make this language object oriented.

The book teaches when and how OOP should be correctly applied. It emphasizes not only the simple syntax of OOP in Python, but also how to combine these objects into well-designed software.

This book will introduce you to the terminology of the object-oriented paradigm, focusing on object-oriented design with step-by-step examples. It will take you from simple inheritance, one of the most useful tools in the object-oriented programmer's toolbox, all the way through to cooperative inheritance, one of the most complicated. You will be able to raise, handle, define, and manipulate exceptions.

You will be able to integrate the object-oriented and the not-so-object-oriented aspects of Python. You will also be able to create maintainable applications by studying higher level design patterns. You'll learn the complexities of string and file manipulation, and how Python distinguishes between binary and textual data. Not one, but two very powerful automated testing systems will be introduced to you. You'll understand the joy of unit testing and just how easy they are to create. You'll even study higher level libraries such as database connectors and GUI toolkits and how they apply object-oriented principles.

Table of Contents

Chapter 1: Object-oriented Design
Object-oriented?
Objects and classes
Specifying attributes and behaviors
Hiding details and creating the public interface
Composition and inheritance
Case study
Exercises
Summary
Chapter 2: Objects in Python
Creating Python classes
Modules and packages
Who can access my data?
Case study
Exercises
Summary
Chapter 3: When Objects are Alike
Basic inheritance
Multiple inheritance
Polymorphism
Case study
Exercises
Summary
Chapter 4: Expecting the Unexpected
Raising exceptions
Handling exceptions
Exception hierarchy
Exceptions aren't exceptional
Case study
Exercises
Summary
Chapter 5: When to Use Object-oriented Programming
Treat objects as objects
Using properties to add behavior to class data
Managing objects
Case study
Exercises
Summary
Chapter 6: Python Data Structures
Empty objects
Tuples and named tuples
Dictionaries
Lists
Sets
Extending built-ins
Case study
Exercises
Summary
Chapter 7: Python Object-oriented Shortcuts
Python built-in functions
Comprehensions
Generators
An alternative to method overloading
Functions are objects too
Case study
Exercises
Summary
Chapter 8: Python Design Patterns I
Design patterns
Decorator pattern
Observer pattern
Strategy pattern
State pattern
Singleton pattern
Template pattern
Exercises
Summary
Chapter 9: Python Design Patterns II
Adapter pattern
Facade pattern
Flyweight pattern
Command pattern
Abstract factory pattern
Composite pattern
Exercises
Summary
Chapter 10: Files and Strings
Strings
File IO
Storing objects
Exercises
Summary
Chapter 11: Testing Object-oriented Programs
Why test?
Unit testing
Testing with py.test
How much testing is enough?
Case Study
Exercises
Summary
Chapter 12: Common Python 3 Libraries
Database access
Pretty user interfaces
XML
CherryPy
Exercises
Summary

What You Will Learn

  • Implement objects in Python by creating classes and defining methods
  • Separate different objects into a taxonomy of classes, and describe the properties and behaviors of those objects via the class interface
  • Design public interfaces using abstraction, encapsulation, and information hiding
  • Turn your designs into working software by learning the Python syntax
  • Share implementation using inheritance
  • Add functionality to the existing classes and built-ins using inheritance
  • Share similar code between classes by abstracting it into a parent class
  • Raise, handle, define, and manipulate exceptions using special error objects
  • Understand when to use object-oriented features, and more importantly when not to
  • Learn what design patterns are, and why they are different in Python
  • Uncover the simplicity of unit testing and why it's so important in Python
  • Utilize common Python 3 modules, libraries, and frameworks

Authors

Table of Contents

Chapter 1: Object-oriented Design
Object-oriented?
Objects and classes
Specifying attributes and behaviors
Hiding details and creating the public interface
Composition and inheritance
Case study
Exercises
Summary
Chapter 2: Objects in Python
Creating Python classes
Modules and packages
Who can access my data?
Case study
Exercises
Summary
Chapter 3: When Objects are Alike
Basic inheritance
Multiple inheritance
Polymorphism
Case study
Exercises
Summary
Chapter 4: Expecting the Unexpected
Raising exceptions
Handling exceptions
Exception hierarchy
Exceptions aren't exceptional
Case study
Exercises
Summary
Chapter 5: When to Use Object-oriented Programming
Treat objects as objects
Using properties to add behavior to class data
Managing objects
Case study
Exercises
Summary
Chapter 6: Python Data Structures
Empty objects
Tuples and named tuples
Dictionaries
Lists
Sets
Extending built-ins
Case study
Exercises
Summary
Chapter 7: Python Object-oriented Shortcuts
Python built-in functions
Comprehensions
Generators
An alternative to method overloading
Functions are objects too
Case study
Exercises
Summary
Chapter 8: Python Design Patterns I
Design patterns
Decorator pattern
Observer pattern
Strategy pattern
State pattern
Singleton pattern
Template pattern
Exercises
Summary
Chapter 9: Python Design Patterns II
Adapter pattern
Facade pattern
Flyweight pattern
Command pattern
Abstract factory pattern
Composite pattern
Exercises
Summary
Chapter 10: Files and Strings
Strings
File IO
Storing objects
Exercises
Summary
Chapter 11: Testing Object-oriented Programs
Why test?
Unit testing
Testing with py.test
How much testing is enough?
Case Study
Exercises
Summary
Chapter 12: Common Python 3 Libraries
Database access
Pretty user interfaces
XML
CherryPy
Exercises
Summary

Book Details

ISBN 139781849511261
Paperback404 pages
Read More
From 2 reviews

Read More Reviews

Recommended for You

Building Machine Learning Systems with Python Book Cover
Building Machine Learning Systems with Python
$ 29.99
$ 6.00
Mastering Object-oriented Python Book Cover
Mastering Object-oriented Python
$ 26.99
$ 18.90
Learning Python for Forensics Book Cover
Learning Python for Forensics
$ 47.99
$ 33.60
Expert Python Programming Book Cover
Expert Python Programming
$ 26.99
$ 5.40
Zen Cart: E-commerce Application Development Book Cover
Zen Cart: E-commerce Application Development
$ 29.99
$ 21.00
Learning Python Design Patterns Book Cover
Learning Python Design Patterns
$ 14.99
$ 10.50