exercism/xpython — pull request #152 by mambocab (2014-12-24 00:52:07+00:00)
Title: fixes grade-school tests to enforce order

[The specification](https://github.com/exercism/x-common/blob/master/grade-school.md) for this exercise requires that the user's code return "a sorted list of all students in all grades". However, the previous test compared the result against a dictionary, which doesn't enforce that order. This PR addresses that. Works on Python 3.4 and 2.7 on my machine.

It should accept only ordered iterators that return tuples. This generator-based implementation also works:

```python
def sort(self):
for grade, students in self.db.items():
yield (grade, tuple(sorted(students)))
```

I don't see how to express in the tests that this implementation also works. If so, LMK and I'll submit a new PR if that's the right thing to do..

closes #151. See that issue for design decisions implemented here.

Made possible by great feedback from @Dog and @sjakobi! Thanks, y'all!