Python Standard Exception topic

Source: Internet
Author: User

Python Standard Exception topic


Assertionerror Assertion Statement

(assert) failed

Attributeerror attempting to access an unknown object property

Eoferror user input file End flag EOF (CTRL+D)

Floatingpointerror floating-point calculation error

When the Generatorexitgenerator.close () method is called

Importerror when the Import module fails

Indexerror index out of range of sequence

Find a non-existent keyword in the Keyerror dictionary

Keyboardinterrupt user input interrupt key (CTRL + C)

Memoryerror Memory Overflow (can free memory by deleting objects)

Nameerror attempting to access a non-existent variable

Notimplementederror methods that have not yet been implemented

OSError exceptions generated by the operating system (for example, opening a nonexistent file)

Overflowerror numeric operation exceeds maximum limit

Referenceerror Weak reference (weak reference) attempts to access an object that has been reclaimed by the garbage collection mechanism

RuntimeError General run-time errors

Stopiteration iterator with no more values

Syntax error for SyntaxError python

Indentationerror Indent Error

Taberror tab and spaces mixed use

Systemerrorpython Compiler system error

Systemexitpython compiler process is closed

TypeError invalid operations between different types

Unboundlocalerror access to an uninitialized local variable (subclass of Nameerror)

Unicodeerror Unicode-related errors (subclasses of ValueError)

Error Unicodeencodeerror Unicode encoding (subclass of Unicodeerror) Unicodedecodeerror

Error in Unicode decoding (subclass of Unicodeerror)

Unicodetranslateerror Error in Unicode conversion (subclass of Unicodeerror)

ValueError invalid arguments passed in

Zerodivisionerror Divisor is zero

Python built-in hierarchy of exception classes:

Baseexception
+--Systemexit
+--Keyboardinterrupt
+--Generatorexit
+--Exception
+--stopiteration
+--Arithmeticerror
| +--Floatingpointerror
| +--Overflowerror
| +--Zerodivisionerror
+--Assertionerror
+--Attributeerror
+--Buffererror
+--Eoferror
+--Importerror
+--Lookuperror
| +--Indexerror
| +--Keyerror
+--Memoryerror
+--Nameerror
| +--Unboundlocalerror
+--OSError
| +--Blockingioerror
| +--Childprocesserror
| +--Connectionerror
| | +--Brokenpipeerror
| | +--Connectionabortederror
| | +--Connectionrefusederror
| | +--Connectionreseterror
| +--Fileexistserror
| +--Filenotfounderror
| +--Interruptederror
| +--Isadirectoryerror
| +--Notadirectoryerror
| +--Permissionerror
| +--Processlookuperror
| +--Timeouterror
+--Referenceerror
+--RuntimeError
| +--Notimplementederror
+--SyntaxError
| +--Indentationerror
| +--Taberror
+--Systemerror
+--TypeError
+--ValueError
| +--Unicodeerror
| +--Unicodedecodeerror
| +--Unicodeencodeerror
| +--Unicodetranslateerror
+--Warning
+--deprecationwarning
+--pendingdeprecationwarning
+--runtimewarning
+--syntaxwarning
+--userwarning
+--futurewarning
+--importwarning
+--unicodewarning
+--byteswarning
+--resourcewarning

Python Standard Exception topic

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.