your feedback to my first project please
patrick at bierans.de
patrick at bierans.de
Sun Jan 8 14:46:49 EST 2012
Thanks for the feedback!
I took the time reading and understanding it and to let it getting into my
bones. And I also lost time on reading more of this freaky and interesting
documentation and was testing a lot of different stuff with my enviroment.
My current code can be seen here if you are interested:
http://pastebin.com/3fz6qm9z #AverageStack.py
http://pastebin.com/tUSGs3gb #TestAverageStack.py
Here are my replies to your time consuming and informative replies ;)
> D'Arcy wrote: [code examples]
Python has some really interesting tricks I have not seen in php.
For example: self._data = [default] * dim - That's nice. :)
And allowing the getter to also set a value was a nice idea.
I meant: def avg(self, value=None)
Thanks for that! :)
But I will keep some of my underscores for "private" attributes and methods.
And I googled: "dim" was basic. I know too many languages and start mixing
the keywords - shame on me. ;)
> D'Arcy and Peter wrote: [about writing testcases]
Good Eye: I wrote the tests after coding - I know that this is the wrong way.
I just wanted to start coding and after some time I decided that I shoud have
some test cases. This is no real TDD - true. ;) I'll do that right next time.
> Peter wrote: You must be doing it [writing test cases] wrong.
After thinking about it: Yupp. You are right. Having written tests to check
"private" attributes really hurts one's pride. ;)
> Peter wrote: You need "from __future__ import division"
Thanks for pointing me to it. I really would have fallen for it!
> Peter wrote: assert False, " %s, %s ?" % ("red", "yellow")
Can you do that with a.avg() instead of a string like "red"?
TIA,
Patrick
PS:
> gene wrote: [plain text emails]
Thanks for pointing me to that. But it was the mistake of my webmailer. I am
well aware of the etiquette of mailing lists. (As you can see my mail was
wordwrapped accordingly.)
But I will not blame you for full quoting my html email... *cough* ;-P
I hope I can get my webmailer to go for plain text email. The option is set
but does not seam to apply. ?(
More information about the Python-list
mailing list