Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
There will (probably) be problems with Unicode. For example, for model names in 2.7, you need to overload __unicode__, and in 3rd - __str__. Well, do not forget that http will send everything in a single-byte encoding, which in the 3rd python is designated as the bytes type, not str. Therefore, sometimes you have to do decode.
For example, in the flask in the 3rd branch, the test client saves data in the response object as bytes, and JSON can only work with strings (which are now only Unicode in the 3rd branch). Needs to be decoded. Although in the framework itself (not in the test client) you do not need to do this, it decodes itself as it should.
Well, read the main differences between the branches: print is now a function, the dictionary methods iteritems, iterkeys, itervalues are abolished, since iterators are now used by default (only items, keys, values remain). Some libs (including urllib) have changed the structure, so some modules will need to be imported differently. Well, and so on.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question