Syntax Highlighting

Tuesday, 1 January 2013

ProgEx: Python Ex1 rev 1 comments

  1. The code won't run from the command line under linux, nor does it run from the Python command line. Feature request?
  2. I made a change to how the sqrt function works (it was even more 'hacky'). Actually the whole check for negative numbers the using the complex math library seems a bit clunky. Options? Major sin: I didn't check to see if it works. I'll post it anyway.*
  3. On that note, I have a feeling that the sqrt function only returns the first value. Fails functional spec. D'oh.A comment on the spec: three of the functions expect a single return value, however the fourth (sqrt), expects a list to be returned. Something that should have considered in the 'architecture'.
  4. Should the doit() have been called main(), and the output in that routine, instead of printing the result of doit()?
  5. The shebang line to make it run on Linux was expected. It was a bit of easter egg to try and get people to check further...
  6. I hadn't got up to the chapter on list comprehensions, or I've skipped it.
  7. sys.exit instead of exit. That appears to be a bit of a trap.
  8. It should have unit testing in the module specified. 
  9. Docstrings are absent.

No comments:

Post a Comment