[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-i18n-doc
Subject: Re: Making pology python3 compatible
From: Adrián Chaves <adrian () chaves ! io>
Date: 2019-06-17 9:18:38
Message-ID: 1727179.JUh9RIV5WR () pondal
[Download RAW message or body]
Six is great when you want to support both Python 2 and Python 3, but if we are just switching to Python 3 (and given how long Python 2 has, I think we should), we should not use Six.
O luns, 17 de xuño de 2019 11:00:07 CEST Luigi Toscano escribiu:
> Chusslove Illich ha scritto:
> >> [: Shinjo Park :]
> >> I tested a blind conversion of 2to3 and execution didn't worked well (also
> >> gave minor warnings). Running posieve on 2to3-processed files gave errors
> >> on pology/colors.py, possibly due to str/unicode changes and separation on
> >> py3. Any other parts utilizing string needs to be examined, especially
> >> decode() and encode() calls.
> >
> > Right, that doesn't work, and 2to3 also produces too "dirty" modifications.
> > So the way would be to run 2to3 and examine each modification in turn, check
> > if it is needed at all or if it should be somewhat different. Afterwards
> > also manually consider most frequent kinds of alterations when going from
> > Python 2 to 3, where in the code such cases could be found.
>
> Another idea could be the (at least partial) usage of porting libraries like
> six of future).
>
> They don't help with the most complicated porting issue (str vs byte), but
> they can speed up with other changes. I've seen six used in OpenStack, and
> future in other project.
>
> Ciao
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic