O'Reilly logo

Effective Python: 90 Specific Ways to Write Better Python, 2nd Edition by Brett Slatkin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9. Testing and Debugging

Python doesn’t have compile-time static type checking. There’s nothing in the interpreter that will ensure that your program will work correctly when you run it. Python does support optional type annotations that can be used in static analysis to detect many kinds of bugs (see Item 90: “Consider Static Analysis via typing to Obviate Bugs” for details). However, it’s still fundamentally a dynamic language, and anything is possible. With Python, you ultimately don’t know if the functions your program calls will be defined at runtime, even when their existence is evident in the source code. This dynamic behavior is both a blessing and a curse.

The large numbers of Python programmers out there say it’s worth going without ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required