Interesting question. I like that the later is performing feature detection
over the former's use of version numbers.


On Wed, Aug 28, 2013 at 8:39 PM, Luiz Irber <notifications@github.com>wrote:

> In screed/screedRecord.py:
>
> > @@ -1,8 +1,17 @@
> > -import UserDict
> > +# compatibility with antique versions of Python,
> > +# although I suspect that the rest in not compatible
> > +# with Python < 2.6 anyway...
> > +import sys
> > +if sys.version_info[0] == 2 and sys.version_info[1] < 6:
> > +    import UserDict
> > +    MutableMapping = UserDict.DictMixin
> > +else:
> > +    from collections import MutableMapping
>
> Is this version-checking style preferred to
>
> try:
>     from collections import MutableMapping
> except ImportError:
>     import UserDict
>     MutableMapping = UserDict.DictMixin```
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/ged-lab/screed/pull/4/files#r6050665>
> .
>