4 ms·
I would presume most people who are writing 3.x code have written 2.x code before, or don't care about 2.x. I personally have gotten used to the syntax that wor
by wbond 13y ago
I would presume most people who are writing 3.x code have written 2.x code before, or don't care about 2.x. I personally have gotten used to the syntax that works in both, and tend to write my code in the most compatible manner possible.
- bru 13y agoThat's something for which I should strive. I've never written "polyglot" scripts longer than 1 file with 100 lines. Writing compatible syntax is feasible without too much hassle, but most problems I encountered were when I wanted to use a library whose API evolved between 2 and 3... Do you have experience with the `six` library[0]? I've read a few times about it recently and it seems a convenient way to write portable code. I still wait for an opportunity to use it! 0: http://pythonhosted.org/six/ http://pythonhosted.org/six/
- pyre 13y agoYou can see some usage here[1]. Mostly just using it to check for string types, but it's the only usage example that I could pull off the top of my head. [1] https://github.com/twilio/flask-restful/blob/master/flask_restful/reqparse.py https://github.com/twilio/flask-restful/blob/master/flask_re...