# 十三、标准库

Python 总是“自带电池”。这句话的意思是标准的 CPython 发行版自带一些库，可用于文件、线程、网络、网站、音乐、键盘、屏幕、文本等，还有一系列实用工具。

CPython 的这些“自带电池”就像是五号电池，几乎适用于任何场合，例如 `collections` 模块和 `sys` 模块。但也有些不常用的模块，就像小型手表电池那样：你不知道它们在什么时候会派上用场。

CPython 标准库中有两种模块类型：

1. 用纯 Python 编写的功能模块
2. 用 C 编写并用 Python 进行封装的模块

你将在本章中探索这两种模块类型。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hai-shi.gitbook.io/cpython-internals/13-stdlib.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
