adafruit / Adafruit_CircuitPython_GPS

GPS parsing module for CircuitPython. Meant to parse NMEA data from serial GPS modules.
MIT License
75 stars 58 forks source link

fix bug where byte str comparision was done incorrectly #70

Closed jkittner closed 2 years ago

jkittner commented 2 years ago

while writing the tests in #69 I found a small bug, where the behavior might be unexpected. Indexing a bytestring with b'abc'[0] will return an integer (97), which is the decimal representation of the ascii character a. Accessing ranges (b'abc'[:1]) works as expected.

tannewt commented 2 years ago

Shouldn't it still match b"P"?

jkittner commented 2 years ago

yes, you are correct, this was left from my first approach where I decoded the string for comparision.