Open cool-RR opened 4 years ago
Well I see a call
in the middle, so I think that's just how PySnooper interprets generators resuming execution, like what I mentioned here: https://github.com/alexmojaki/snoop/wiki/Comparison-to-PySnooper#generators
Hmm, interesting. Do you think that if I were to cherry-pick that feature out of snoop, this bug would be solved without any changes to the start_times
logic?
I don't think it would be that simple, but I think the process of extracting that feature would probably make it pretty easy to understand and fix this bug.
I'm guessing the reset happens here https://github.com/cool-RR/PySnooper/blob/master/pysnooper/tracer.py#L381
Awesome, thanks for the information. I'll check it out.
On Mon, May 4, 2020 at 6:54 PM Alex Hall notifications@github.com wrote:
I don't think it would be that simple, but I think the process of extracting that feature would probably make it pretty easy to understand and fix this bug.
I'm guessing the reset happens here https://github.com/cool-RR/PySnooper/blob/master/pysnooper/tracer.py#L381
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cool-RR/PySnooper/issues/182#issuecomment-623548134, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAN3SUXYWLKHVD7FZCOWNDRP3QLTANCNFSM4MY3EIIQ .
God damn it, this is complicated.
I made a failing test, but figuring out how to fix the behavior is hard. @iory , @alexmojaki if any of you could be interested in trying this bug, feel free.
I found a bug with
relative_time
when used with a generator. The times shown seem to be reset at some point. I don't know whether this bug could also happen without generators.@iory Can you take a look at this bug?
@alexmojaki I suspect that this has something to do with the
start_times
dict you suggested.Sample:
Output: