byte compiled files

Terry Reedy tjreedy at home.com
Thu Jul 26 14:17:47 EDT 2001


"Mark Robinson" <m.1.robinson at herts.ac.uk> wrote in message
news:3B602FA0.6030809 at herts.ac.uk...
> can anyone shed some light on the mysterious behaviour of my byte
> compiled files. I am currently working on a python script which
analyses
> patterns in a DNA sequence. I have a function which checks a pattern
(a
> substring of approx 6 chars) to ensure only valid charactors are
> present. When I first run this program it runs fine, but if I
> immediately rerun the program (i.e using the pre-byte compiled file)
it
> finds all patterns non-valid. If I delete the .pyc file between runs
> this problem does not occur. Can anyone explain what is happening
here
> to me and how to prevent it?
>
> blobby

[Always say which version of the interpreter you are having such
problems with]

There is a known bug, whose details I forget, in the writing/rereading
of .pyc files that changes the arithmetic or representation of floats,
and which exhibits the re-run/delete behavior you describe.  I believe
it has been or will be fixed in 2.2.  Maybe the same (try 2.2a1 if you
can), maybe related.  To pin it down, put print statements in your
'is_valid()' function, or before, to find the statement that gets
altered.  Good luck.

Terry J. Reedy






More information about the Python-list mailing list