[issue42373] PEP 626 does not specify behavior of tracing for keywords.

2020-12-04 Thread Mark Shannon


Change by Mark Shannon :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42373] PEP 626 does not specify behavior of tracing for keywords.

2020-11-23 Thread Mark Shannon


Mark Shannon  added the comment:

https://github.com/python/peps/pull/1722/

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42373] PEP 626 does not specify behavior of tracing for keywords.

2020-11-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Mark, could you kindly create a proposed update to the PEP in the form of a PR 
so I can evaluate it and we can iterate directly over the final specification?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42373] PEP 626 does not specify behavior of tracing for keywords.

2020-11-16 Thread Mark Shannon


New submission from Mark Shannon :

PEP 626 doesn't cover which keywords are to be traced if they occur on a line 
by themselves.

Some keywords, like `break`, in Python have behavior associated with them.
Others, like `else` are just syntax and don't do anything.
Currently, it is not clear which keywords get traced and which do not.


I'd like to update the PEP to include the following:

Keywords can be broken down into five groups.
1. Must have an attendant expression ( "if", "while", "for", "await")
   These keywords are not traced, since their expressions are.
2. Have an optional expression and perform non-local control flow ( "return", 
"yield", "raise", "except" )
   These keywords are traced. If on a different line from the expression, they 
will generate additional events.
3. Pure syntax ( "else", "try", "finally" )
   These keywords are not traced.
4. Local control flow ( "break", continue", "pass" )
   These keywords are traced
5. Expressions ( "None", "True", "False" )
   Treated like other expressions


Examples:

1. if (
2.test
3. ):

will generate an event for line 2.


1. return (
2.x
3. ):

will generate an event for line 2, then line 1.

1. try:
2.None
3. finally:
4.pass

Will generate an event for line 2, then line 4.


Note that whatever changes, the invariant remains that if a line is in 
`co_lines()` then it will generate trace events, and if it isn't then it won't.

--
assignee: Mark.Shannon
messages: 381114
nosy: Mark.Shannon, nedbat, pablogsal
priority: normal
severity: normal
status: open
title: PEP 626 does not specify behavior of tracing for keywords.
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com