qgis/QGIS-Documentation — pull request #168 by snorfalorpagus (2013-11-23 14:14:54+00:00)
Title: Layer fields should be updated after changes in the data provider.

After modifying a layer's fields in the data provider the cache of the fields in the layer need to be updated as they are not automatically propagated.

This commit adds a comment and code example to this effect in the pyqgis cookbook in the section on modifying vector layers.