Minimal strawman proposal. New keyword debug. 

debug EXPRESSION

Executes EXPRESSION when in debug mode. 

debug context

Prints all the variables of the enclosing closure and all the variable names 
accessed within that block. For example, if in foo you access the global 
variable spam, spam would be printed. The format would be:

variableName: value
variableTwo: value

where "value" is the repr() of the variable.
Separated by new lines. The exact output format would not be part of the spec.

?identifier

would print "identifier: value." Repr as before. Using this in non-debug mode 
emits a warning.

?identifier.property.property

is also valid.

A new property descriptor on the global variable, “debugger.” This is an alias 
for importing PDB and causing the debugger to pause there. 

The behavior of this descriptor in non-debug mode is TBD.

Debug mode may be specified per-module at interpreter launch.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/B2FLIPTEFG72HTEA2DHAYBXMDKLNTRVP/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to