Friday, November 22, 2013

wNov18_2013 ~ Something new and something old

Hi again readers,

First thing first, I congratulate myself for getting quite a good mark on the test I did previous week. Yay!! :D :D :)

As for this week’s lesson, the lectures were about hidden attributes, equality, and reduce, which I have mostly known already from my previous java knowledge except reduce.

A funny thing about python’s hidden attributes are that it does not strictly enforce us to not be able to use private variable but rather just add an ‘_’ to tell us to please not use it. Nonetheless, making a variable private means we will need a getter and a setter to operate on it.
Equality is also straight forward as we just need to write what attribute to compare in __eq__ method.

Reduce is something that I haven’t learned about yet. Seems to me that it takes an iterable and ‘reduce’ it into a single value. So it is kind of like the method ‘sum’. I have not yet fully understand Reduce, so I will be looking into it a bit more.



Thank you for reading,
pilpho
o(@ _ @~*)o

No comments:

Post a Comment