turicas/outputty — Issue #4: Should change table.rows instead of only table.data in some operations
Author: turicas
Created: 2011-12-14 00:23:25+00:00
State: open

Some operations that some methods do (like `Table._organize_data` and `Table.order_by`) modify the contents of `self.data` but __don't modify__ `self.rows`. It's against the [rule of least surprise](http://en.wikipedia.org/wiki/Principle_of_least_astonishment). An example:

table = Table(headers=['spam', 'eggs'])
table.rows.append(['python', 'rules'])
table.rows.append(['monty', 'python'])
table.order_by('eggs')

Only `table.data` will be changed. So if we execute `print table`, `table.to_csv()` or `table.to_html()`, the content returned will be ordered, but `table.rows` will remain unchanged! This can cause some surprise and is not desired.