3 things to remember about programming in Python

  1. If one wants to retrieve a value using a custom function, one must use the "return" keyword. For example, simply calling .get(key) on a dictionary will not magically return the .gotten(key) value!
  2. If one prints a method that prints statements, one will notice an extraneous "None" printed out. That is because the method returned None. Solution: don't print the method; just call it.
  3. If one has an alarm programmed into one's wristwatch, after which one has privately agreed to no longer do any programming, one should listen to one's self. Otherwise, one bangs head against one's desk trying to fix the two aforementioned "bugs".

Oy.


Written by Andrew Ittner in misc on Wed 22 September 2004. Tags: programming, python