💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 5.10. 小结 实打实的对象把戏到此为止。你将在 [第 12 章](../soap_web_services/index.html) 中看到一个真实世界应用程序的专有类方法,它使用 `getattr` 创建一个到远程 Web 服务的代理。 下一章将继续使用本章的例程探索其他 Python 的概念,例如:异常、文件对象 和 `for` 循环。 在研究下一章之前,确保你可以无困难地完成下面的事情: * 使用 [`import _module_`](../getting_to_know_python/everything_is_an_object.html#odbchelper.import "例 2.3. 访问 buildConnectionString 函数的 doc string") 或 [`from _module_ import`](importing_modules.html "5.2. 使用 from module import 导入模块")导入模块 * 定义和[实例化](instantiating_classes.html "5.4. 类的实例化")类 * 定义 [`__init__` 方法](defining_classes.html#fileinfo.class.example "例 5.4. 定义 FileInfo 类")和其他[专用类方法](special_class_methods.html "5.6. 专用类方法"),并理解它们何时会调用 * 子类化 [`UserDict`](userdict.html "5.5. 探索 UserDict:一个封装类") 来定义行为像字典的类 * 定义[数据属性](userdict.html#fileinfo.userdict.init.example "例 5.9. 定义 UserDict 类")和[类属性](class_attributes.html "5.8. 类属性介绍"),并理解它们之间的不同 * 定义[私有属性和方法](private_functions.html "5.9. 私有函数")