For PEP 553, I think it’s a good idea to support the environment variable 
$PYTHONBREAKPOINT[*] but I’m stuck on a design question, so I’d like to get 
some feedback.

Should $PYTHONBREAKPOINT be consulted in breakpoint() or in 
sys.breakpointhook()?

If we support it in breakpoint() then it means if $PYTHONBREAKPOINT is set, 
Python will never call sys.breakpointhook() so programmatic override of that 
will be ignored.

If we support it in sys.breakpointhook(), then if you programmatically override 
that, $PYTHONBREAKPOINT will be ignored even if set.  Of course, any code that 
overrides sys.breakpointhook() could also consult $PYTHONBREAKPOINT if they 
want.

So how do we want it to work?  It seems like explicit code should override the 
environment variable, which should override the default, meaning that 
$PYTHONBREAKPOINT should be consulted only in breakpoint().  And if you set 
sys.breakpointhook() with something else, then oh well, Python just ignores 
$PYTHONBREAKPOINT.

Feedback welcome.
-Barry

[*] Probably not $PYTHONBREAKPOINTHOOK although if we choose to implement that 
in sys.breakpointhook(), it might still makes sense.

Attachment: signature.asc
Description: Message signed with OpenPGP

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to