Need some Python 3 help

Paul McGuire ptmcg at austin.rr.com
Tue May 25 22:04:07 EDT 2010


On May 25, 8:58 pm, Benjamin Peterson <benja... at python.org> wrote:
> Paul McGuire <ptmcg <at> austin.rr.com> writes:
>
> > In this section of code, instring is a string, loc is an int, and wt
> > is a string.  Any clues why instring[loc] would be evaluating as int?
> > (I am unfortunately dependent on the kindness of strangers when it
> > comes to testing my Python 3 code, as I don't have a Py3 environment
> > installed.)
>
> Indexing bytes in Python 3 gives an integer.

Hrmm, I had a sneaking hunch this might be the issue.  But then I
don't know how this code *ever* worked in Python 3, as it is chock
full of indexed references into the string being parsed.  And yet,
I've had other folks test and confirm that pyparsing_py3 *does* work
on Python 3.  It is a puzzle.

-- Paul



More information about the Python-list mailing list