autotest/autotest — pull request #647 by rbbratta (2013-05-17 07:45:37+00:00)
Title: Add various backports of Python 2.6 builtins: next(), any(), all(), bin()

This module contains four backports of Python 2.6 methods:
`next()` from Ross Brattain
`any()` from http://stackoverflow.com/questions/3785433/python-backports-for-some-methods
`all()` from http://stackoverflow.com/questions/3785433/python-backports-for-some-methods
`bin()` from http://code.activestate.com/recipes/576847/

These backports should be conditionally imported upon exception so they
do not shadow the builtin function on newer Pythons.

Example:

```python
try:
any([True])
except NameError:
from autotest.client.shared.backports import any
```

Justification:

Using backports for builtin functions allow for forward-compatibility and
speeds on newer python versions.

`bin()` is used heavily in decoded hardware register bits.
`any()` and `all()` are useful for generators and list comprehensions
`next()` is useful because of the default argument, and it is consistent with
Python 3 usage.

Signed-off-by: Ross Brattain