On 12/15/14 7:42 PM, Ben Finney wrote:
As for the advice to avoid such a declaration, you're arguing against the official guide for porting Python 2 code to 2-and-3 compatible code:For text you should either use the from __future__ import unicode_literals statement or add a u prefix to the text literal. <URL:https://docs.python.org/3.4/howto/pyporting.html#text-versus-binary-data> So, the declarative import is specifically recommended. You'll need to present a case for why I shouldn't follow that recommendation.
What's wrong with this part of the recommendation?: "or add a u prefix to the text literal."
Also, keep in mind, these recommendations are not infallible. They are sometimes written before there's been broad experience with the solution. Your use of __import__ puts you in a tiny minority of programs, so the recommendation that's good for 99% of code may not work for you.
Be flexible. Do what works. -- Ned Batchelder, http://nedbatchelder.com -- https://mail.python.org/mailman/listinfo/python-list
