摘要
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.
說明
影片
地點
R1
時間
第二天 • 13:25-13:55 (GMT+8)
語言
英文演講
層級
中階
分類
Python 核心