Book Image

Sage Beginner's Guide

By : Craig Finch
1 (1)
Book Image

Sage Beginner's Guide

1 (1)
By: Craig Finch

Overview of this book

Table of Contents (17 chapters)
Sage Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Potential pitfalls when working with classes and instances


We've learned the general thought processes and the syntax needed to design our own classes, and organize them in modules and packages. In the following example, we're going to move away from our combat simulation and construct some simple test classes to further illustrate how Python classes work. The purpose of these examples is to demonstrate some behavior that may seem strange and cause your programs to behave in unexpected ways if you don't understand the underlying principles.