The foundation of Python: inner objects in Python

flydean 2021-04-06 09:39:36
foundation python inner objects python


brief introduction

Python There are many very useful objects built in , This article will introduce Python Built in functions in , Built in constants , Built in types and built-in exceptions .

Built in functions

Python The interpreter has many built-in functions and types , You can use them at any time .

Built in functions
abs() delattr() hash() memoryview() set()
all() dict() help() min() setattr()
any() dir() hex() next() slice()
ascii() divmod() id() object() sorted()
bin() enumerate() input() oct() staticmethod()
bool() eval() int() open() str()
breakpoint() exec() isinstance() ord() sum()
bytearray() filter() issubclass() pow() super()
bytes() float() iter() print() tuple()
callable() format() len() property() type()
chr() frozenset() list() range() vars()
classmethod() getattr() locals() repr() zip()
compile() globals() map() reversed() __import__()
complex() hasattr() max() round()

Built in constants

Python A small number of constants are built in , We can use them directly in the code .

  • False

It means bool False value of type .

  • True

It means bool The truth value of the type .

  • None

yes NoneType Unique value of type .None Indicates a lack of value .

  • NotImplemented

yes __eq__(), __lt__(), __add__(), __rsub__() Special return value of , Indicates that it will return a false value NotImplemented.

  • Ellipsis

Equivalent to literal value , It is mainly used in combination with the extended slicing syntax of user-defined container data types .

  • __debug__

Variables inside the compiler , Used to indicate whether to turn on debug Pattern .

Built in type

python The main built-in types in are numbers 、 Sequence 、 mapping 、 class 、 Instances and exceptions .

Logical value detection

stay python in , Any object can do logical value detection .

An object is considered true by default , Unless when the object is called, its class defines __bool__() Method and returns False Or defined __len__() Method and returns zero .

Here's the focus that's supposed to be false Value object :

  • Constants defined as false values : None and False.
  • Zero of any numeric type : 0, 0.0, 0j, Decimal(0), Fraction(0, 1)
  • Empty sequences and multinomial sets : '', (), [], {}, set(), range(0)

Boolean operations of logical values

Boolean operations mainly include or, not and and:

operation result
x or y if x is false, then y, else x
x and y if x is false, then x, else y
not x if x is false, then True, else False

Comparison operations

operation meaning
< Strictly less than
<= Less than or equal to
> Strictly greater than
>= Greater than or equal to
== be equal to
!= It's not equal to
is Object identifier
is not Negative object identification

Instance comparison results of classes with different identities are usually unequal , Unless the class defines __eq__() Method .

Numeric type

Python There are three different data types in : Integers , Floating point numbers and The plural .

All number types ( Except the plural ) All support the following operations :

operation result
x + y x and y And
x - y x and y Difference
x * y x and y The product of the
x / y x and y The business of
x // y x and y The quotient of
x % y x / y The remainder of
-x x Take the opposite
+x x unchanged
abs(x) x The absolute value or size of

about int and float The following operations are also supported :

operation result
math.trunc(x) x Truncated to Integral
Round(x[, n]) x Round to n Decimal place , The half value is rounded to an even number . If omitted n, The default is 0.
math.floor(x) <= x Maximum Integral
math.ceil(x) >= x Minimum Integral

Bit operations of integer type

For integers , It also supports bit operations :

operation result
x | y x and y Bitwise or
x ^ y x and y Bitwise Exclusive or
x & y x and y Bitwise And
x << n x Move left n position
x >> n x Move right n position
~x x Reverse bit by bit

Additional methods of integer type

int There are some extra ways :

int.bit_length()

Returns the number of bits needed to represent an integer in binary , Does not include sign bits and preceding zeros :

>>> n = -37
>>> bin(n)
'-0b100101'
>>> n.bit_length()
6

int.to_bytes(length, byteorder, *, signed=False)

Returns an array of bytes representing an integer .

(1024).to_bytes(2, byteorder='big')
b'\x04\x00'
(1024).to_bytes(10, byteorder='big')
b'\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00'
(-1024).to_bytes(10, byteorder='big', signed=True)
b'\xff\xff\xff\xff\xff\xff\xff\xff\xfc\x00'
x = 1000
x.to_bytes((x.bit_length() + 7) // 8, byteorder='little')
b'\xe8\x03'

byteorder Parameter determines the byte order used to represent integers . If byteorder by "big", The highest byte is placed at the beginning of the byte array . If byteorder by "little", The highest byte is placed at the end of the byte array .

signed Parameter to determine whether to use the complement of two to represent an integer .

Additional methods for floating point types

float.is_integer()

If float If the instance can be represented by a finite bit integer, it returns True, Otherwise return to False:

>>> (-2.0).is_integer()
True
>>> (3.2).is_integer()
False

float.hex()

Returns a floating-point representation in the form of a hexadecimal string .

iterator

Iterators are mainly used in container traversal .

If the container needs to provide iterative support , The following methods must be defined :

container.__iter__()

This method returns an iterator object . This iterator object needs to provide the following two methods :

iterator.__iter__()

Returns the iterator object itself .

iterator.__next__()

Returns the next item from the container .

Sequence type

There are three basic sequence types :list, tuple and range object .

Here's the general sequence of operations :

operation result
x in s If s One of the items in is equal to x The result is True, Otherwise False
x not in s If s One of the items in is equal to x The result is False, Otherwise True
s + t s And t Phase splicing
s * n or n * s amount to s Do it with yourself n Secondary splicing
s[i] s Of the i term , Starts 0
s[i:j] s from i To j The section of
s[i:j:k] s from i To j In steps of k The section of
len(s) s The length of
min(s) s The smallest term of
max(s) s The largest term of
s.index(x[, i[, j]]) x stay s The index number of the first occurrence of an item in ( The index number is in i Or after and in j Before )
s.count(x) x stay s The total number of occurrences in

Variable sequence type operations :

operation result
s[i] = x take s Of the i Replace item with x
s[i:j] = t take s from i To j Replace the slice of with an iteratable object t The content of
del s[i:j] Equate to s[i:j] = []
s[i:j:k] = t take s[i:j:k] The element of is replaced by t The elements of
del s[i:j:k] Remove from list s[i:j:k] The elements of
s.append(x) take x Add to the end of the sequence ( Equate to s[len(s):len(s)] = [x])
s.clear() from s Remove all items from ( Equate to del s[:])
s.copy() establish s The shallow copy ( Equate to s[:])
s.extend(t) or s += t use t Content extension of s ( It's basically the same as s[len(s):len(s)] = t)
s *= n Use s The content of the article is repeated n Next time to update it
s.insert(i, x) In by i The given index location will x Insert s ( Equate to s[i:i] = [x])
s.pop([i]) Extract in i Items in position , And take it from s Remove
s.remove(x) Delete s First of all s[i] be equal to x Project .
s.reverse() Reverse the elements in the list in place .

Sequence types include lists , Tuples ,range Objects and text sequences str.

Let's focus on str Methods :

operation result
str.capitalize() Returns a copy of the original string , Its first character is capitalized , The rest are in lowercase .
str.casefold() Returns a case free copy of the original string . Case eliminated strings can be used to ignore case matching .
str.center(width[, fillchar]) Return length is width String , The original string is in its center . Use specified fillchar Fill in the space on both sides ( By default ASCII Space character ). If width Less than or equal to len(s) Returns a copy of the original string .
str.count(sub[, start[, end]]) Reverse substring sub stay [start, end] The number of non overlapping occurrences in the range . Optional parameters start And end Will be interpreted as slice representation .
str.encode(encoding="utf-8", errors="strict") Returns the version of the original string encoded as a byte string object . The default encoding is 'utf-8'.errors The default value is 'strict', Indicates that a coding error will cause UnicodeError. Other available values are 'ignore', 'replace', 'xmlcharrefreplace', 'backslashreplace' And any other way through codecs.register_error() Registered value
str.endswith(suffix[, start[, end]]) If the string is in the specified suffix End return True, Otherwise return to False. suffix It can also be a tuple composed of multiple suffixes for searching .
str.expandtabs(tabsize=8) Returns a copy of the string , All tabs are replaced by one or more spaces , Depending on the current column position and given tab width .
str.find(sub[, start[, end]]) Returns a substring sub stay s[start:end] The smallest index found in the slice .
str.format(args*, kwargs) Perform string formatting operations .
str.format_map(mapping) Be similar to str.format(**mapping), The difference is mapping Will be used directly rather than copied to a dict.
str.index(sub[, start[, end]]) Be similar to find(), But when no subclass is found, it raises ValueError.
str.isalnum() If all the characters in the string are letters or numbers and there is at least one character , Then return to True , Otherwise return to False .
str.isalpha() If all the characters in the string are letters , And at least one character , return True , Otherwise return to False .
str.isascii() If the string is empty or all the characters in the string are ASCII , return True , Otherwise return to False .
str.isdecimal() If all characters in a string are decimal and the string has at least one character , Then return to True , Otherwise return to False .
str.isdigit() If all the characters in the string are numbers , And at least one character , return True , Otherwise return to False .
str.isidentifier() If the string is a valid identifier , return True
str.islower() If there is at least one case sensitive character in the string If all such characters are lowercase, return True , Otherwise return to False .
str.isnumeric() If there is at least one character in the string and all characters are numeric, returns True , Otherwise return to False .
str.isprintable() Returns... If all characters in the string are printable or the string is empty True , Otherwise return to False .
str.isspace() If there is at least one white space character in the string True , Otherwise return to False .
str.istitle() Returns... If there is at least one character in the string and it is a title string True , For example, uppercase characters can only be followed by non uppercase characters, while lowercase characters must start with uppercase characters . Otherwise return to False .
str.isupper() If there is at least one case sensitive character in the string 4 If all such characters are uppercase, return True , Otherwise return to False .
str.join(iterable) Returns a iterable String stitched from string in .
str.ljust(width[, fillchar]) Return length is width String , The original string is left aligned in it .
str.lower() Returns a copy of the original string , All of its case sensitive characters All converted to lowercase .
str.lstrip([chars]) Returns a copy of the original string , Remove the leading character .
str.partition(sep) stay sep The first place to split the string , Return to one 3 Tuples , It contains the part before the separator 、 The separator itself , And the part after the separator .
str.removeprefix(prefix, /) If the string Prefix Start of string , return string[len(prefix):] . otherwise , Returns a copy of the original string
str.removesuffix(suffix, /) If the string suffix End of string , also suffix Non empty , return string[:-len(suffix)] . otherwise , Returns a copy of the original string
str.replace(old, new[, count]) Returns a copy of the string , All substrings that appear in it old Will be replaced by new. If optional parameters are given count, Only before replacement count time .
str.rfind(sub[, start[, end]]) Returns a substring sub The largest... Found within a string ( The most right ) Indexes , such sub Will be included in s[start:end] among .
str.rindex(sub[, start[, end]]) Be similar to rfind(), But in substrings sub When not found, raises ValueError.
str.rjust(width[, fillchar]) Return length is width String , The original string is right aligned in it .
str.rpartition(sep) stay sep The last occurrence splits the string , Return to one 3 Tuples , It contains the part before the separator 、 The separator itself , And the part after the separator . If the separator is not found , The return of the 3 The tuple contains two empty strings and the string itself .
str.rsplit(sep=None, maxsplit=-1) Returns a list of words in a string , Use sep As a separate string . If given maxsplit, At most maxsplit Sub resolution , from Far right Start .
str.rstrip([chars]) Returns a copy of the original string , Remove the character at the end of .
str.split(sep=None, maxsplit=-1) Returns a list of words in a string , Use sep As a separate string . If given maxsplit, At most maxsplit Sub resolution ( therefore , The list will have at most maxsplit+1 Elements ). If maxsplit Not specified or is -1, The number of splits is not limited ( Make all possible splits ).
str.splitlines([keepends]) Returns a list of lines in the original string , Split at the line boundary . The result list does not contain row boundaries , Unless you give keepends And it's true .
str.startswith(prefix[, start[, end]]) If the string is in the specified prefix At the beginning, return to True, Otherwise return to False. prefix It can also be a tuple composed of multiple prefixes for searching . If there are options start, The check will start from the specified position . If there are options end, The comparison will stop at the specified location .
str.strip([chars]) Returns a copy of the original string , Remove the leading and ending characters . chars The parameter is the string that specifies the character to be removed . If omitted or None, be chars Parameter removes the space character by default . actually chars The parameter does not specify a single prefix or suffix ; Instead, all combinations of parameter values are removed :
str.swapcase() Returns a copy of the original string , Where uppercase characters are converted to lowercase , vice versa .
str.title() Returns the title version of the original string , The first letter of each word is capitalized , The rest of the letters are lowercase .
str.upper() Returns a copy of the original string , All case sensitive characters are converted to uppercase .
str.zfill(width) Returns a copy of the original string , Fill in on the left ASCII '0' The number makes its length width. Positive and negative prefixes ('+'/'-') The way to deal with it is in positive and negative symbols after Fill in, not before . If width Less than or equal to len(s) Returns a copy of the original string .

There are also several binary sequence types : bytes, bytearray, memoryview.

bytes An object is an immutable sequence of a single byte .

Express bytes The syntax of a literal is roughly the same as that of a string literal , Just added a b Prefix .

bytearray The object is bytes Variable counterparts of objects .bytearray Object has no literal Syntax , They are always created by calling the constructor .

Let's take a look at bytes and bytearray Basic operation :

operation describe
bytearray.count(sub[, start[, end]]) Returns the subsequence sub stay [start, end] The number of non overlapping occurrences in the range . Optional parameters start And end Will be interpreted as slice representation .
bytearray.removeprefix(prefix, /) If binary data is represented by Prefix Start of string , return bytes[len(prefix):] . otherwise , Returns a copy of the original binary data
bytearray.removesuffix(suffix, /) If binary data is represented by suffix End of string , also suffix Non empty , return bytes[:-len(suffix)] . otherwise , Returns a copy of the original binary data
bytearray.decode(encoding="utf-8", errors="strict") Return from given bytes Decoded string . The default encoding is 'utf-8'.
bytearray.endswith(suffix[, start[, end]]) If the binary data is in the specified suffix At the end, return to True, Otherwise return to False.
bytearray.find(sub[, start[, end]]) Returns the subsequence sub The smallest index found in the data ,sub Contained in slices s[start:end] within .
bytearray.index(sub[, start[, end]]) Be similar to find(), But when a subsequence cannot be found, it raises ValueError.
bytearray.join(iterable) Returns a iterable The binary data sequence in bytes or bytearray object .
bytearray.maketrans(from, to) Returns an object that can be used for bytes.translate() The conversion table of , It will from Each character in is mapped to to Characters in the same position in ;from And to Must be Byte class object And have the same length .
bytearray.partition(sep) stay sep The first position splitting sequence , Return to one 3 Tuples , It contains the part before the separator 、 The separator itself or its bytearray copy , And the part after the separator .
bytearray.replace(old, new[, count]) Returns a copy of the sequence , All the subsequences that appear in it old Will be replaced by new. If optional parameters are given count, Only before replacement count time .
bytearray.rfind(sub[, start[, end]]) Returns the subsequence sub The largest one found in the sequence ( The most right ) Indexes , such sub Will be included in s[start:end] among . Optional parameters start And end Will be interpreted as slice representation . If not found, return -1.
bytearray.rindex(sub[, start[, end]]) Be similar to rfind(), But in subsequences sub When not found, raises ValueError.
bytearray.rpartition(sep) stay sep The last occurrence of the position splitting sequence , Return to one 3 Tuples , It contains the part before the separator , The separator itself or its bytearray copy , And the part after the separator .
bytearray.startswith(prefix[, start[, end]]) If the binary data is in the specified prefix Return at the beginning True, Otherwise return to False.
bytearray.translate(table, /, delete=b'') Go back to the original bytes or bytearray Copy of object , Remove all of them in the optional parameters delete What happened in bytes, rest bytes Will be mapped through the given transformation table , The conversion table must be of length 256 Of bytes object .
bytearray.center(width[, fillbyte]) Returns a copy of the original object , In the length of width In the middle of the sequence , Use specified fillbyte Fill in the space on both sides ( By default ASCII Space character ). about bytes object , If width Less than or equal to len(s) Returns a copy of the original sequence .
bytearray.ljust(width[, fillbyte]) Returns a copy of the original object , In the length of width Align left in the sequence of .
bytearray.lstrip([chars]) Returns a copy of the original sequence , Remove the specified leading byte .
bytearray.rjust(width[, fillbyte]) Returns a copy of the original object , In the length of width Right aligned in the sequence of .
bytearray.rsplit(sep=None, maxsplit=-1) Splitting binary sequences into subsequences of the same type , Use sep As a separator .
bytearray.rstrip([chars]) Returns a copy of the original sequence , Remove the specified end byte .
bytearray.split(sep=None, maxsplit=-1) Splitting binary sequences into subsequences of the same type , Use sep As a separator .
bytearray.strip([chars]) Returns a copy of the original sequence , Remove the specified start and end bytes .
bytearray.capitalize() Returns a copy of the original sequence , Each of these bytes will be interpreted as a ASCII character , And the first byte is uppercase and the rest lowercase . Not ASCII The byte value will remain unchanged .
bytearray.expandtabs(tabsize=8) Returns a copy of the sequence , All of them ASCII Tabs are made up of one or more ASCII Space replacement , Depending on the current column position and given tab width .
bytearray.isalnum() If all the bytes in the sequence are alphabetic ASCII Character or ASCII If the decimal number and the sequence is not empty, return True , Otherwise return to False .
bytearray.isalpha() If all the bytes in the sequence are alphabetic ASCII Character and the sequence is not null True , Otherwise return to False .
bytearray.isascii() If the sequence is empty or all the bytes in the sequence are ASCII Bytes return True , Otherwise return to False .
bytearray.isdigit() If all the bytes in the sequence are ASCII If the decimal number and the sequence is not empty, return True , Otherwise return to False .
bytearray.islower() If there is at least one lowercase in the sequence ASCII Characters and no uppercase ASCII The character returns True , Otherwise return to False .
bytearray.isspace() If all the bytes in the sequence are ASCII Blank and the sequence is not empty True , Otherwise return to False .
bytearray.istitle() If the sequence is ASCII If the title is in case and the sequence is not empty, return True , Otherwise return to False .
bytearray.isupper() If there is at least one capital letter in the sequence ASCII Characters and no lowercase ASCII The character returns True , Otherwise return to False .
bytearray.lower() Returns a copy of the original sequence , It's all capitalized ASCII Characters are converted to the corresponding lowercase form .
bytearray.splitlines(keepends=False) Returns a list of rows in the original binary sequence , stay ASCII Position split of line boundary character .
bytearray.swapcase() Returns a copy of the original sequence , It's all lowercase ASCII All characters are converted to their corresponding uppercase form , And vice versa .
bytearray.title() Returns the title version of the original binary sequence , Each word is capitalized ASCII The character begins with , The rest of the letters are lowercase . Case insensitive byte values will remain unchanged .
bytearray.upper() Returns a copy of the original sequence , It's all lowercase ASCII All characters are converted to their corresponding uppercase form .
bytearray.zfill(width) Returns a copy of the original sequence , Fill in on the left b'0' The number makes the sequence length width. Positive and negative prefixes (b'+'/ b'-') The way to deal with it is in positive and negative symbols after Fill in, not before .

memoryview Object allowed Python The code accesses the internal data of an object , As long as the object supports Buffer protocol Without copying .

obj Buffer protocol must be supported . Built in objects that support buffer protocols include bytes and bytearray.

Collection types

The data stored in the collection is not duplicate . There are mainly set and frozenset Two kinds of .

set The type is variable --- Its content can be used add() and remove() This way to change . Because it's a variable type , It has no hash value , And can't be used as a dictionary key or other collection element .

frozenset The type is immutable and is hashable --- Its content cannot be changed after being created ; So it can be used as a dictionary key or as an element of other collections .

Take a look at the basic operation of a set :

operation describe
len(s) Back to the assembly s The number of elements in ( namely s Base number of ).
x in s testing x Is it s Members of the .
x not in s testing x Whether it's not s Members of the .
isdisjoint(other) If there is no relation between other Common elements return True. If and only if the intersection of two sets is an empty set , They are disjoint sets .
issubset(other) perhaps set <= other Detect if every element in the collection is other In .
set < other Check if the set is other The proper subset of , namely set <= other and set != other.
issuperset(other) perhaps set >= other Check if other Every element in is in the collection .
set > other Check if the set is other It's a super collection , namely set >= other and set != other.
union(*others) perhaps set | other | ... Return to a new collection , It contains information from the original set and others All elements in the specified collection .
intersection(*others) perhaps set & other & ... Return to a new collection , It contains the original set and others Elements common to all collections specified .
difference(*others) perhaps set - other - ... Return to a new collection , Which contains the original set in others Elements that do not exist in the specified other collection .
symmetric_difference(other) perhaps set ^ other Return to a new collection , The elements in it either belong to the original set or to other Other collections specified , But not both .
copy() Returns a shallow copy of the original collection .

Mapping type

python The mapping type in is dict. As long as it is hashable Can be used as dict Of key.

Dictionaries can be created in many ways :

  • Use curly braces to separate... With commas key : value Right way : {'jack': 4098, 'sjoerd': 4127} or {4098: 'jack', 4127: 'sjoerd'}
  • Use dictionary derivation : {}, {x: x ** 2 for x in range(10)}
  • Use type constructors : dict(), dict([('foo', 100), ('bar', 200)]), dict(foo=100, bar=200)

If the position parameter is not given , An empty dictionary will be created .

Dictionary operation :

operation describe
list(d) Return dictionary d A list of all the keys used in .
len(d) Return dictionary d Number of items in .
d[key] return d China and Israel key Is the key's item .
d[key] = value take d[key] Set to value.
del d[key] take d[key] from d Remove .
key in d If d There is a key in key Then return to True, Otherwise return to False.
key not in d Equivalent to not key in d.
iter(d) Returns the iterator whose element is the key of the dictionary . This is a iter(d.keys()) Shortcut to .
clear() Remove all elements from the dictionary .
copy() Returns a shallow copy of the original dictionary .
get(key[, default]) If key If it exists in the dictionary, it returns key Value , Otherwise return to default. If default If not given, the default is None
items() Returns a new view made up of dictionary keys .
pop(key[, default]) If key If it exists in the dictionary, remove it and return its value , Otherwise return to default.
popitem() Remove from dictionary and return a ( key , value ) Yes . The key value pair will press LIFO The order of is returned .
reversed(d) Returns an iterator that gets the dictionary key in reverse order . This is a reversed(d.keys()) Shortcut to .
setdefault(key[, default]) If there is a key in the dictionary key , Returns its value . If it doesn't exist , Insert value is default Key key , And back to default . default The default is None.
update([other]) Use from other Key / Value pair update Dictionary , Override the original key . return None.
values() Returns a new view of dictionary values .
d | other Merge d and other To create a new dictionary , Both have to be dictionaries . When d and other When you have the same key , other The value of has priority .
d |= other use other Update dictionary with key and value of d ,other It can be mapping or iterable The key/value pair . When d and other When you have the same key , other The value of has priority .

Dictionary view object

from dict.keys(), dict.values() and dict.items() The returned object is View objects . This object provides a dynamic view of dictionary entries , This means that when the dictionary changes , The view changes accordingly .

The dictionary view can be iterated to produce its corresponding data , And support member detection :

operation describe
len(dictview) Returns the number of entries in the dictionary .
iter(dictview) Returns the key in the dictionary 、 Value or item ( With ( key , value ) Is the tuple representation of an element ) The iterator .
x in dictview If x Is the key that exists in the corresponding dictionary 、 Value or item ( In the last case x It should be a ( key , value ) Tuples ) Then return to True.
reversed(dictview) Returns a key to get the dictionary in reverse order 、 Iterators for values or items . The view iterates in the reverse order as it was inserted .

Built-in exception

Python All the exceptions in are from BaseException , Let's look at the hierarchy of built-in exceptions :

BaseException
+-- SystemExit
+-- KeyboardInterrupt
+-- GeneratorExit
+-- Exception
+-- StopIteration
+-- StopAsyncIteration
+-- ArithmeticError
| +-- FloatingPointError
| +-- OverflowError
| +-- ZeroDivisionError
+-- AssertionError
+-- AttributeError
+-- BufferError
+-- EOFError
+-- ImportError
| +-- ModuleNotFoundError
+-- 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
| +-- RecursionError
+-- SyntaxError
| +-- IndentationError
| +-- TabError
+-- SystemError
+-- TypeError
+-- ValueError
| +-- UnicodeError
| +-- UnicodeDecodeError
| +-- UnicodeEncodeError
| +-- UnicodeTranslateError
+-- Warning
+-- DeprecationWarning
+-- PendingDeprecationWarning
+-- RuntimeWarning
+-- SyntaxWarning
+-- UserWarning
+-- FutureWarning
+-- ImportWarning
+-- UnicodeWarning
+-- BytesWarning
+-- ResourceWarning

This article has been included in http://www.flydean.com/11-python-inner-obj/

The most popular interpretation , The deepest dry goods , The most concise tutorial , There are so many tricks you don't know about waiting for you to discover !

Welcome to my official account. :「 Program those things 」, Know technology , Know you better !

版权声明
本文为[flydean]所创,转载请带上原文链接,感谢
https://pythonmana.com/2021/04/20210406093548177K.html

  1. 利用Python爬虫获取招聘网站职位信息
  2. Using Python crawler to obtain job information of recruitment website
  3. Several highly rated Python libraries arrow, jsonpath, psutil and tenacity are recommended
  4. Python装饰器
  5. Python实现LDAP认证
  6. Python decorator
  7. Implementing LDAP authentication with Python
  8. Vscode configures Python development environment!
  9. In Python, how dare you say you can't log module? ️
  10. 我收藏的有关Python的电子书和资料
  11. python 中 lambda的一些tips
  12. python中字典的一些tips
  13. python 用生成器生成斐波那契数列
  14. python脚本转pyc踩了个坑。。。
  15. My collection of e-books and materials about Python
  16. Some tips of lambda in Python
  17. Some tips of dictionary in Python
  18. Using Python generator to generate Fibonacci sequence
  19. The conversion of Python script to PyC stepped on a pit...
  20. Python游戏开发,pygame模块,Python实现扫雷小游戏
  21. Python game development, pyGame module, python implementation of minesweeping games
  22. Python实用工具,email模块,Python实现邮件远程控制自己电脑
  23. Python utility, email module, python realizes mail remote control of its own computer
  24. 毫无头绪的自学Python,你可能连门槛都摸不到!【最佳学习路线】
  25. Python读取二进制文件代码方法解析
  26. Python字典的实现原理
  27. Without a clue, you may not even touch the threshold【 Best learning route]
  28. Parsing method of Python reading binary file code
  29. Implementation principle of Python dictionary
  30. You must know the function of pandas to parse JSON data - JSON_ normalize()
  31. Python实用案例,私人定制,Python自动化生成爱豆专属2021日历
  32. Python practical case, private customization, python automatic generation of Adu exclusive 2021 calendar
  33. 《Python实例》震惊了,用Python这么简单实现了聊天系统的脏话,广告检测
  34. "Python instance" was shocked and realized the dirty words and advertisement detection of the chat system in Python
  35. Convolutional neural network processing sequence for Python deep learning
  36. Python data structure and algorithm (1) -- enum type enum
  37. 超全大厂算法岗百问百答(推荐系统/机器学习/深度学习/C++/Spark/python)
  38. 【Python进阶】你真的明白NumPy中的ndarray吗?
  39. All questions and answers for algorithm posts of super large factories (recommended system / machine learning / deep learning / C + + / spark / Python)
  40. [advanced Python] do you really understand ndarray in numpy?
  41. 【Python进阶】Python进阶专栏栏主自述:不忘初心,砥砺前行
  42. [advanced Python] Python advanced column main readme: never forget the original intention and forge ahead
  43. python垃圾回收和缓存管理
  44. java调用Python程序
  45. java调用Python程序
  46. Python常用函数有哪些?Python基础入门课程
  47. Python garbage collection and cache management
  48. Java calling Python program
  49. Java calling Python program
  50. What functions are commonly used in Python? Introduction to Python Basics
  51. Python basic knowledge
  52. Anaconda5.2 安装 Python 库(MySQLdb)的方法
  53. Python实现对脑电数据情绪分析
  54. Anaconda 5.2 method of installing Python Library (mysqldb)
  55. Python implements emotion analysis of EEG data
  56. Master some advanced usage of Python in 30 seconds, which makes others envy it
  57. python爬取百度图片并对图片做一系列处理
  58. Python crawls Baidu pictures and does a series of processing on them
  59. python链接mysql数据库
  60. Python link MySQL database