1. Default Encoding

The default encoding is ASCII (for now) and that's annoying if you do any serious programming. You want it to be UTF-8 most likely. Sadly, for reasons I can't quite comprehend, sys.setdefaultencoding() can only be call from the magic sitecustomize.py file. This has been a source of numerous config headaches.

2. Default Arguments

Don't assign lists, dicts, sets or other non-primitives as default arguments to a function. You almost never want to do this. Default initialization only happens once, so you end up reusing the same object. Just avoid this altogether.

last edited 2006-08-15 23:17:58 by MollyMillions