scikit-learn/scikit-learn — pull request #2150 by justinvf (2013-07-10 20:13:34+00:00)
Title: Last of the Python3 Bugs!(?)

I seem to have all tests passing locally for python3 now.

This required changing a lot of doc tests to no longer assert on the output of their values, i.e. changing

```{python}
>>> foo()
[u'a', u'b']
```

To

```{python}
>>> foo() == ['a', 'b']
True
```

This is because unicode strings do not print with the preceding u in python3.

Two changes to this file that I would like special attention to:

sklearn/base.py:206
This logic required that DeprecationWarnings would show up after calling getattr. This for some reason was getting broken in python3. Adding this here seems a little bit like a hack. We already make a call like that in utils/__init__.py, but it was not sticking around.

sklearn/tests/test_cross_validation.py:71
We were checking the dimensions relative to the global variable 'y' instead of the local variable 'Y'. I switched it to 'Y', that makes more sense relative to the code in cross_validation.py:1035, which resizes the fit parameters relative to the cross validation set size.

Look forward to getting validation of this on the jenkins build so I know I didn't break any python2 stuff in the process.