README.md 1.17 KB
Newer Older
Zed's avatar
Zed committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
This is the start of a hand-crafted Object Oriented System using just basic Python capabilities such as modules, function calls, and dicts.  It's intended to be an educational look at how an OOP system works so that you can understand it in depth.  I (Zed Shaw) will slowly build the system up from basics until it's functional enough, and then potentially implement a different kind of OOP that is foreign to Python.

This repository is the one I use in the videos for the Learn Code Live OOP School series of videos.

Design Questions
=========

* All the features of OOP, OR all the features people use?
* Do we do a python style OOP, or do we do a message passing system.
* Do we need efficiency?

Answers for First Attempt
====

* Mostly the features people use.
    - No MRO
* Python style OOP.
    - No message passing.
* Not worry about efficiency.

Features
====

* Functions on data.
* Subclass so a missing function will look at a parent class.
* Type information.
* Define a class, and then make objects from it.
* Encapsulation


Zed's avatar
Zed committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
Running The Tests
====

First you do:

```
export PYTHONPATH=.
```

Then you can do:

```
python3 test_oop.py
```

The test passes if you get NO output.