
json — JSON encoder and decoder — Python 3.13.3 documentation
1 day ago · Decode a JSON document from s (a str beginning with a JSON document) and return a 2-tuple of the Python representation and the index in s where the document ended.
18.2. json — JSON 编码和解码器 — Python 2.7.18 文档
Feb 7, 2018 · The RFC requires that JSON be represented using either UTF-8, UTF-16, or UTF-32, with UTF-8 being the recommended default for maximum interoperability. Accordingly, this module uses UTF-8 as the default for its encoding parameter.
Unicode HOWTO — Python 3.13.3 documentation
1 day ago · This sequence of code points needs to be represented in memory as a set of code units, and code units are then mapped to 8-bit bytes. The rules for translating a Unicode string into a sequence of bytes are called a character encoding, or just an encoding.
codecs — Codec registry and base classes - Python
1 day ago · Refer to Codec Base Classes for more information on codec error handling. The full details for each codec can also be looked up directly: codecs.lookup(encoding) ¶ Looks up the codec info in the Python codec registry and returns a CodecInfo object as defined below. Encodings are first looked up in the registry’s cache.
7. Input and Output — Python 3.13.3 documentation
3 days ago · Rather than having users constantly writing and debugging code to save complicated data types to files, Python allows you to use the popular data interchange format called JSON (JavaScript Object Notation).
io — Core tools for working with streams — Python 3.13.3 …
1 day ago · Text Encoding ¶ The default encoding of TextIOWrapper and open() is locale-specific (locale.getencoding()). However, many developers forget to specify the encoding when opening text files encoded in UTF-8 (e.g. JSON, TOML, Markdown, etc…) since most Unix platforms use UTF-8 locale by default.
Unicode HOWTO — Python 2.7.18 ドキュメント
>>> u = unichr(40960) + u'abcd' + unichr(1972) # Assemble a string >>> utf8_version = u.encode('utf-8') # Encode as UTF-8 >>> type(utf8_version), utf8_version (<type 'str'>, '\xea\x80\x80abcd\xde\xb4') >>> u2 = utf8_version.decode('utf-8') # Decode using UTF-8 >>> u == u2 # The two strings match True
urllib.parse — Parse URLs into components — Python 3.13.3 …
1 day ago · urllib.parse.parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None, separator='&') ¶ Parse a query string given as a string argument (data of type application/x-www-form-urlencoded).
Python Documentation contents — Python 3.13.3 documentation
Why does Python use methods for some functionality (e.g. list.index ()) but functions for other (e.g. len (list))? Why is join () a string method instead of a list or tuple method?
inspect — Inspect live objects — Python 3.12.10 documentation
Mar 12, 2010 · inspect.isdatadescriptor(object) ¶ Return True if the object is a data descriptor. Data descriptors have a __set__ or a __delete__ method. Examples are properties (defined in Python), getsets, and members. The latter two are defined in C and there are more specific tests available for those types, which is robust across Python implementations.