I am looking at this python code for EPGReader and am trying to understand how reader = self.PIDHandlers.get(headers.PID, None)works. What does the get return?
So, PIDHandlers is dict is made up of the TSSectionReader class and that calls the SDTSectionContainer class. Have I understood this correctly?
My goal is to add code to process PAT tables and I am forcing myself to understand someone else’s code instead of copping out and writing my own.
PIDHandlersis adict, yes. Thegetcall returnsPIDHandlers[headers.PID]ifheaders.PIDis inPIDHandlers.keys(), orNoneotherwise.getis just adictaccess which doesn’t throwKeyError, instead returning the given default.