1. Home
  2. Computing & Technology
  3. Python

Python's Built-In Warnings

By Al Lukaszewski, About.com

The following is a complete list of Python warnings that can be raised. While most of these are self-explanatory, I have added brief descriptions to them for sake of clarity; these are derived from the "Built-in Exceptions" module of the Python 2.5 documentation.


  • Warning: Base class for warning categories.

  • UserWarning: Base class for warnings generated by user code.

  • DeprecationWarning: Base class for warnings about deprecated features.

  • PendingDeprecationWarning: Base class for warnings about features which will be deprecated in the future.

  • SyntaxWarning: Base class for warnings about dubious syntax

  • RuntimeWarning: Base class for warnings about dubious runtime behavior.

  • FutureWarning: Base class for warnings about constructs that will change semantically in the future.

  • ImportWarning: Base class for warnings about probable mistakes in module imports. New in version 2.5.

  • UnicodeWarning: Base class for warnings related to Unicode. New in version 2.5.



Explore Python

More from About.com

  1. Home
  2. Computing & Technology
  3. Python
  4. Python Library
  5. Python's Built-In Warnings

©2008 About.com, a part of The New York Times Company.

All rights reserved.