Outdated version of the documentation. Find the latest one here.

PyQGIS Developer Cookbook