Practices
Tests : unit tests, integration tests and functional tests are the way you must do your job.
The most surprising is unit tests is far more complex to do than others because you need to create a code structure that let you replace your dependencies on the framework by fake implementation:
For exemple you can check this code: https://github.com/collective/collective.gallery/tree/master/collective/gallery/tests
utils.py contains fake components I next use in the setup to be sure I only use THE class I'm testing.
Packaging
I'm using 'egg' to package my code and make it easy to use. So you can publish your add-on on the website http://pypi.python.org
To create an egg you can use PasteScript: http://pypi.python.org/pypi/PasteScript
To understand packaging you have to understand this:
- distutils is just the setup.py file to say what are your dependencies and how to build & install the package
- setuptools add the easy_install command with pypi as default egg repository (kind of apt-get). Today there is a fork of setuptools named distribute.
- buildout add a way to get multiple version of the same eggs and it build the system path inside 'scripts' put in a bin folder: http://www.buildout.org/
Performance
No matter what performances are never checked first and this is bad. We are working on performances when there are performances issues.
http://pypi.python.org/pypi/funkload is a great tool to create performance tests.
Python provide tools to profile your code. I let you google that.
Private
Never hide sth to other developers, useless and boring for them. 'property' make your public variable wrapped by accessor&mutator and do the job you want (never broke things)
http://docs.python.org/library/functions.html#property
Database
I'm use to http://pypi.python.org/pypi/psycopg2 with postgresql. Python embed the sqlite binding since 2.5 to build tests
You should also consider that the http://zodb.org/ZODB can be used outside of Zope framework and is one of the oldest nosql database on python.
Books
My favorite one: http://www.packtpub.com/expert-python-programming/book
Favorties packages & tools