pydata/pandas — pull request #6863 by unutbu (2014-04-10 15:41:18+00:00)
Title: BUG: _tidy_repr should not be called when max_rows is None

This issue was raised in http://stackoverflow.com/q/22824104/190597:

```
import pandas as pd
pd.options.display.max_rows = None
result = pd.Series(range(1001))
print(result)
```

raises `TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'`.

The problem occurs in series.py (line 832) when `max_rows` is `None`:

if len(self.index) > (max_rows or 1000):
result = self._tidy_repr(min(30, max_rows - 4))

Since the doc string for `get_options` says

```
display.max_rows: [default: 60] [currently: 60]
...
'None' value means unlimited.
```

I think `_tidy_repr` should not be called when `max_rows` is None.

This PR seems simple enough but my main concern is that this PR stomps on GH1467 explicitly changed `> max_rows` to `> (max_rows or 1000)` and I don't know what the purpose of this was.