python-uds icon indicating copy to clipboard operation
python-uds copied to clipboard

Comments on DecodeFunctions.py

Open beckyc567 opened this issue 7 years ago • 0 comments

DecodeFunctions.py

  • specified pretty much everything in the documentation section at the top, except a version - do you need to at this level?

  • the commenting runs out a bit early

  • is there a reason for ...

def stringToIntList(aString, encodingType): result = [] [result.append(ord(i)) for i in aString] return result

... rather than ..

def stringToIntList(aString, encodingType): return [ord(i) for i in aString]

... or ...

def stringToIntList(aString, encodingType): result = [ord(i) for i in aString] return result
... i.e. in the event that you might want to use the intermediate result before returning?

  • intArrayToIntArray fails if given an unrecognised outputType - it's OK for inputType as you have the unconditional else - could just slap an unconditional else to trap it as for inputType, or possibly add a defensive exception trap around the code or allow the function simply throw an exception to the parent - if you follow the inputType structure, I would guess the "int8" path is the default?

beckyc567 avatar Sep 03 '18 08:09 beckyc567