Commit f8bc14de authored by Zed's avatar Zed

And just a little tweak since S5 isn't new code.

parent 4ec7576e
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
Running The Tests
====
First you do:
```
export PYTHONPATH=.
```
Then you can do:
```
python3 test_oop.py
```
The test passes if you get NO output.
......@@ -65,3 +65,9 @@ def test_inheritance():
mycar = new(Buick, 'green')
Buick.drive(mycar)
test_new()
test_new_class_no_getset()
test_obj_methods()
test_inheritance()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment