Quote:
Originally Posted by eschwartz
... I'd suggest going forward, to reduce the cognitive burden you should rely on any __future__ imports available (especially unicode_literals), make sure to mark all relevant strings as b'' ...
|
Hi eschwartz,
I've read the above many times and I still don't really understand what you're saying. I'm pretty sure the problem is at my end
- All my plugin .py files have this as the first line:
Code:
from __future__ import (unicode_literals, division, absolute_import, print_function)
Are you saying this will still be OK in Python 3?
- When do you need the b'' thing? Can you give an example of Python2 vs 3 where it would be needed?
- Re: polyglot.builtins iteritems, iterkeys, itervalues.
I have a lot of code that looks something like:
Code:
for k,v in dict.iteritems():
do something with k and v
Is there some reason why the following minor change wouldn't work OK in both Py2 and Py3?
Code:
for k,v in dict.items():
do something with k and v