On Mon, Sep 30, 2019 at 5:46 PM Joram <joram.no...@gmx.de> wrote:

> Am 27.09.19 um 22:34 schrieb Matthew Peveler:
> > long vs int, unicode vs str, StringIO vs io, iter.next vs
> > iter.__next__, reload, xrange vs range.
>
> It is very well feasible to support both version. I hope by shims you
> mean something like¹
>
>     from __future__ import division, print_function
>     from builtins import range
>
> because there is no need to customly write those. I consider the link
> quite helpful.
>
> Cheers
>
>
> ¹ https://python-future.org/compatible_idioms.html


Yes for using __future__, but no for builtins  while it would make things
easier, it is not something that is actually built into python and would be
installable for PyPI via the future package (
https://pypi.org/project/future/). So I had to hand define the shims,
though I mostly went for

python2 -> python3 shim such:
if sys.version_info > (3,):
    xrange = range
    raw_input = input

as I dislike overwriting builtin functions/variables if I can avoid it as
it leads to potentially surprising behavior, though reversing that would
not be very difficult if so desired.

Matt
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to