View Single Post
Old 04-22-2019, 03:34 PM   #7
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by eschwartz View Post
... 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
  1. 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?

  2. When do you need the b'' thing? Can you give an example of Python2 vs 3 where it would be needed?

  3. 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
jackie_w is offline   Reply With Quote