[Python-Dev] PEP 553 (original) (raw)

Guido van Rossum guido at python.org
Mon Oct 2 00:44:57 EDT 2017


Hope you don't mind me CC'ing python-dev.

On Sun, Oct 1, 2017 at 9:38 AM, Barry Warsaw <barry at python.org> wrote:

You seem to be in PEP review mode :)

What do you think about 553? Still want to wait, or do you think it’s missing anything? So far, all the feedback has been positive, and I think we can basically just close the open issues and both the PEP and implementation are ready to go. Happy to do more work on it if you feel it’s necessary. -B

I'm basically in agreement. Some quick notes:

in builtins

def breakpoint(*args, **kwds): import sys return sys.breakpointhook(*args, **kwds)

in sys

def breakpointhook(*args, **kwds): import os hook = os.getenv('PYTHONBREAKPOINT') if hook == '0': return None if not hook: import pdb return pdb.set_trace(*args, **kwds)

if '.' not in hook:
    import builtins
    mod = builtins
    funcname = hook
else:
    modname, funcname = hook.rsplit('.', 1)
    __import__(modname)
    import sys
    mod = sys.modules[modname]
func = getattr(mod, funcname)
return func(*args, **kwds)

breakpointhook = breakpointhook

Except that the error handling should be a bit better. (In particular the PEP specifies a try/except around most of the code in sys.breakpointhook() that issues a RuntimeWarning and returns None.)

That's what I have!

-- --Guido van Rossum (python.org/~guido <http://python.org/%7Eguido>) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20171001/bb439112/attachment.html>



More information about the Python-Dev mailing list