note this implementation does self.prevlines[-1] == self.prev_lineno: for guppy backend only, because repeating [i for i in range(0, 10000000)] makes the guppy backend extremely slow. although this may not be ideal or acceptable i thought it's worth sharing the code.
related to my comment here https://github.com/pythonprofilers/memory_profiler/issues/236#issuecomment-549044946 with implementation of guppy3 we can get the right values.
note this implementation does
self.prevlines[-1] == self.prev_lineno:
for guppy backend only, because repeating[i for i in range(0, 10000000)]
makes the guppy backend extremely slow. although this may not be ideal or acceptable i thought it's worth sharing the code.