Single-letter variables are common. If your use-case is inserting breakpoints 
into arbitrary library code there's no way to guarantee that the builtin won't 
be shadowed by some arguments or other local variables, making your alias 
extremely unreliable.

    def add(a, b):
        """Arbitrary library code."""
        b()  # This will fail because the argument shadows the builtin
        return a + b

Sure you could argue that the `breakpoint` builtin is affected by shadowing 
too, but it's much less common to have a variable named `breakpoint` than `b`.

I think an even worse consequence would be the cryptic error message that 
beginners would be likely to encounter in programming tutorials.

Quick example:

    def add(a):  # Assuming some kind of tutorial about functions
        return a + b

    NameError: name 'b' is not defined

Let's imagine that the beginner made a mistake and forgot to declare the second 
argument. The error message is clear, but with your `breakpoint` alias this is 
what the interpreter will print out:

    TypeError: unsupported operand type(s) for +: 'int' and 
'builtin_function_or_method'

Really confusing. I highly oppose this.
_______________________________________________
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/4VB2TQRS5DLSYN3UVXL7PPTFWMC3ZPB4/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to