Irit Katriel <iritkatr...@gmail.com> added the comment:

Reproduced on 3.11. 


An implicit return doesn't have a line, so it's not clear what should happen. 
Assigning the next line to it wouldn't be correct either (it could be the first 
line of the next function). 

We could say that in this case there is no line event, just a return event 
(unless that messes up the tracer somehow).

If you add a return statement it makes sense:

/Users/iritkatriel/src/cpython/mm.py 7 call
/Users/iritkatriel/src/cpython/mm.py 8 line
/Users/iritkatriel/src/cpython/mm.py 10 line
/Users/iritkatriel/src/cpython/mm.py 11 line
/Users/iritkatriel/src/cpython/mm.py 14 line
/Users/iritkatriel/src/cpython/mm.py 14 return

(line 13 does not appear because that's the else, the return is assigned line 
14 which is where it really is).

----------
nosy: +iritkatriel
title: Invalid 'line' tracer event on pass within else clause -> line number 
when tracing an implicit return
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 
3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue13548>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to