​​On Fri, Feb 10, 2017 at 12:16 PM, john lunzer <[email protected]> wrote:
​
​

Edward, doesn't that statement just scream "*something is wrong with this*"
> to you?
>

​Heh.  I spend way too much time on python 2/3 compatibility.

Alas, it works both ways.​

​For instance, egged on by org-mode, I found this script
<http://stackoverflow.com/questions/9818279/render-equation-to-png-file-using-python>
for converting LaTeX to a picture.  It's a Python 2 script, so to make it
work on 3 I had to change the import to:

if g.isPython3:
    from io import BytesIO as StringIO
else:
    from cStringIO import StringIO

This kind of thing is a *daily* irritation.  It won't go away if we require
Python 3.

There are a lot of things that I like about Python 3, but two things truly
piss me off:

1. The distinction between str and unicode in Python 2 has morphed into the
distinction between bytes and str. How is that *any* kind of improvement?
Worse, str has flipped its meaning!

2. The introduction of incompatible libraries is infuriating. *Adding* new
libraries would have been fine. Removing the old libraries was an insult.

I envy those with the luxury of creating Python 3 code, but these
kinds of *meaningless
*differences will be with us literally forever.  Python 2 isn't going away
in my lifetime, I would guess.

Hmm.  Rather than get stuck in helpless rage, Leo should have a 2-to-3
command that would automatically convert selected text from Python 2 to 3.
Maybe by pasting to the clipboard...

For sure I am going to check out what 2to3 suggests for:

    from cStringIO import StringIO

It had better be good.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to