built-in functions and exceptions built-in warnings python has warnings module that is typically used to notify programmers about deprecated features warnings are issued by including code such as the followingimport warnings warnings warn("the mondo flag is no longer supported"deprecationwarningalthough warnings are issued by library modulethe names of the various warnings are built-in warnings are somewhat similar to exceptions there is hierarchy of builtin warnings that all inherit from exception warning the base class of all warnings subclass of exception userwarning generic user-defined warning subclass of warning deprecationwarning warning for deprecated features subclass of warning syntaxwarning warning for deprecated python syntax subclass of warning runtimewarning warning for potential runtime problems subclass of warning futurewarning warning that the behavior of feature will change in the future subclass of warning warnings are different than exceptions in that the issuing of warning with the warn(function may or may not cause program to stop for examplea warning may just print something to the output or it may raise an exception the actual behavior can be configured with the warnings module or with the - option to the interpreter if you are using someone else' code that generates warningbut you would like to proceed anywaysyou can catch warnings that have been turned into exceptions using try and except for exampletryimport md except deprecationwarningpass it should be emphasized that code such as this is rare although it will catch warning that has been turned into an exceptionit doesn' suppress warning messages (you have to use the warnings module to control thatplusignoring warnings is good way to write code that doesn' work correctly when new versions of python are released lib fl ff