I made some changes to Unit 7. Sharing those changes here for comments or reuse. #390
jdonwells
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
Hi Don, I appreciate your viewpoint on this. I agree that, while the approach in the curriculum may be "Pythonic," it's not good OOP. The structure of unit 7 reflects the approach taken by Allen Downey in the Think Python text that was the basis for the Python curriculum. To be honest, with the curriculum going into maintenance mode, I'm not sure we're going to change the current approach, but I will keep your suggestions in mind as I update unit 7. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The problem I saw with Unit 7 is the way it starts. We show them how to create empty classes and then populate the instances with attributes individually outside of the class. If you have spent any time in this discussion group you can imagine that doesn't work for me.
7.01 So for the first lesson I went over class creation, attributes, and methods. The lab was changed to just ask them to create a class and a method that sets the attributes. Essentially an init method but not init yet. https://docs.google.com/presentation/d/1v-03EpGBxwvYl3tUei4xTI2iQWWns9wZye3NKDP4htc/edit?usp=sharing
7.02 is not changed. They learn about a better way to initialize with the init method.
7.03 Mostly unchanged. The lab is changed to just ask them to create a str method. https://docs.google.com/presentation/d/1wnYQXib_DGD5hIXH15D7w9Lyq8LRm9-KHa9iMsqq52c/edit?usp=sharing
Notice that we are using a piece of our Zork game that was moved to Unit 6 as the basis for the lab.
7.04 is not changed. They learn about inheritance.
7.05 is a new lesson. In this lesson I put everything they have learned together with super() and double dispatch. They are then given a lab to create add methods for two classes. Basically the Kangaroo lab from 7.03 but using double dispatch. They have items and backpacks. You can add an item to a backpack or a backpack to an item. However, you may not add two items or two backpacks together. That will print an error. https://docs.google.com/presentation/d/1fLtSQPkeQyVOJTsL5sAyODp6V6nlFfR7Nh-sFrFnBeA/edit?usp=sharing
Beta Was this translation helpful? Give feedback.
All reactions