python module的结构

python有很多module,下面是module的结构图:

拿httplib做例子,httlip module有:

4个class( HTTPConnection,HTTPSConnection,HTTPResponse,HTTPMessage ),

12个exception( HTTPException,NotConnected,InvalidURL,UnknownProtocol,UnknownTransferEncoding,UnimplementedFileMode,IncompleteRead,ImproperConnectionState,CannotSendRequest,CannotSendHeader,ResponseNotReady,BadStatusLine 

3个constant( HTTP_PORT,HTTPS_PORT,responses 

class会包含method和attribute(不一定有)

拿HTTPResponse做例子,HTTPResponse有:

4个method( read(),getheader(name[,default]),getheaders(),fileno() )

4个constant( msg,version,status,reason )

原文地址:https://www.cnblogs.com/HpuAcmer/p/4074768.html