Open truebit opened 4 years ago
Thanks for the PR.
What problem does it solve? From what I remember, try..catch was a little bit faster and made the code work on Python 2 and 3, while other solutions didn't. I wonder if after change this would still work on PyPy or Python 3.3 for example.
This PR fixes #91 tests failure on python 2.
As I mentioned, map and filter cannot be differed by try...catch, as they both exist in python 2 and 3. sys.version_info was introduced in python2.0. I changed access of named tuple attributes to list index to make it working in >=python2.0
NameError for map and fitler would only occur in python 1. Python 2 and 3 both got these two keywords.
And
type(map(string.lower, 'ABC')) is map
is not true in Python 2, but true in Python 3. So I got a version check to add map and filter.