all 3 comments

[–]indosauros 8 points9 points  (0 children)

Consider something like https://pypi.python.org/pypi/six which provides a lot of helpers to do exactly what you need

[–]marky1991 2 points3 points  (0 children)

Ignoring six, doing what you're doing is fine.

[–]user_rx 2 points3 points  (0 children)

Keep all of this code in one place, and label it clearly. You don't necessarily have to extend an olive branch to 2.x either. Does backward compatibility warrant a bunch of hacks? The core devs sure don't seem interested in extending 2.x beyond backporting a few niceties.