Tuesday, 18 February 2014

Reading Week

It's Reading Week (finally) so I have begun to study for the upcoming term test.

So far I have gone over the first three weeks of lectures, including articles and python examples. Mostly, my reaction has been, "Wow, why didn't I go over this sooner? Maybe then that exercise or that lab would not have seemed so perplexing". Basically, I did not practice enough when we were actually learning this stuff for the first time. Oops.

Some interesting things I have learned that probably everyone else already realized (don't laugh at me):
- creating a __str__ method in a class means you can call str(instance) and print(instance) and they will actually return what you want them to
- Zip creates tuples of pairs that are at the same index in their respective groups (I feel like this method would have been useful in 108 instead of all those 'if s[i] == t[i]...')
- When creating init methods for subclasses, you actually have to say 'superclass.__init__(self) to get it to refer to the superclass. It won't automatically do this for you.

Things I am still confused about:
- unittest. I looked at the Stack Tester example and noticed it's a little different from the unittest file my partner and I created in a lab a couple weeks ago.
- What it is that makes attributes of a class changeable by users and what makes them immutable
- How __repr__ method calls itself recursively in a lot of the classes we created in class

I'm having one of those "the more I study the less I feel like I know" kind of days. Nevertheless, I plan on solving these issues by exploring the info on the python website and trying things out in Wing. Also, I'll probably head over to office hours when I'm back on campus.

No comments:

Post a Comment