Skip to content

false positive for built-in function breakpoint() #994

@nik-sm

Description

@nik-sm

Since python 3.7, there's a built-in breakpoint() function.

pytype incorrectly flags this as an undefined name.

See below for an example when the source file is just a single line.

$ python --version
Python 3.8.5

$ cat scrap.py    
breakpoint()

$ python -m pytype scrap.py
Computing dependencies
Analyzing 1 sources with 0 local dependencies
ninja: Entering directory `.pytype'
[1/1] check scrap
FAILED: .pytype/pyi/scrap.pyi 
python -m pytype.single --imports_info .pytype/imports/scrap.imports --module-name scrap -V 3.8 -o .pytype/pyi/scrap.pyi --analyze-annotated --nofail --quick scrap.py
File "scrap.py", line 1, in <module>: Name 'breakpoint' is not defined [name-error]

For more details, see https://google.github.io/pytype/errors.html#name-error
ninja: build stopped: subcommand failed.
Leaving directory '.pytype'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcat: corecore language and typing features

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions