An Introduction to Object-Oriented Programming
Although often used as a "scripting" language, Python is an object-oriented programming language at its core. This tutorial is designed for programmers who are familiar with Python yet new to the concept of object-oriented programming. We also welcome programmers who are experienced with other object-oriented languages yet new to Python.
We will begin the tutorial by introducing the general principles of object-oriented programming. We then focus on Python's treatment of object orientation. The tutorial will be organized as a mix of formal presentations together with hands-on demonstrations and exercises.
Take your Python programming to the next level!
Presenters
Drs. Goldwasser and Letscher are Faculty Members in the Department of Mathematics and Computer Science at Saint Louis University and authors of the book Object-Oriented Programming in Python. They have been instrumental in the development of SLU's Python-based introductory programming course and are winners of the Jim Korn Award for Scholarship of Teaching and Learning at SLU. Components of their curriculum have been presented at national and international conferences on Computer Science Education and within the main program of PyCon 2008.
Requirements
Minimally, attendees should have basic familiarity with core programming concepts (e.g., variables, control structures, functions).
Attendees should bring laptops with Python installed (version 2.3 or later) if they want to work through the examples.
Outline
- The Object-Oriented Paradigm
- The pairing of data and behavior
- Encapsulation
- Accessors vs. mutators
- Inheritance hierarchies
- Using Objects
- The built-in list class as a typical example of a mutable type.
- The built-in str class as a typical example of an immutable type.
- Numeric types and operators
- Defining Your Own Classes
- Example: A simple Point class
- Example: A more robust Point class
- Example: a Television class
- Example: a Fraction class
- Good Software Practices
- Case Study: a Mastermind game
- Top-level design; bottom-up implementation
- Naming conventions
- Python docstrings
- Encapsulation
- Unit testing
Break -- refreshments served
- Inheritance
- Providing new methods
- Overriding existing methods
- Example: A DeluxeTV
- Example: A SortedSet
- Multiple inheritance
- When should inheritance (not) be used?
- A Deeper Understanding of the Management of Objects
- Understanding objects and references
- Aliasing
- Equivalence testing
- Objects that reference other objects
- Deep vs. shallow copying
- Parameter passing
- Default parameter values
- Python's Internal Mechanisms
- id, type, isinstance
- Python's use of dictionaries (dir, locals, globals, vars)
- Name resolution in an object-oriented framework (local, instance-level, class-level, parent-level namespaces).
- Structural recursion
- Our own (recursive) list implementation
























.