Abstract
Python's warnings are exceptions — but they're also distinct from exceptions, and are both used and trapped differently. In this talk, I'll introduce warnings, how to raise, trap, and redirect them, and show you best practices for their use. Many experienced developers don't know that Python's warning system supports filtering and suppressing warnings quite flexibly, based on a variety of parameters. You can thus turn certain warnings into (potentially fatal) exceptions, or ignore them entirely -- or enjoy the default behavior, in which they appear on the screen. In addition to showing you how you can create and display warnings, I'll also show you how you can create your own, and (perhaps even more significantly) give examples of when they're appropriate.
Description
Video
Location
R1
Date
Day 2 • 13:25-13:55 (GMT+8)
Language
English talk
Level
Intermediate
Category
Python Core