2 个仓库
Code examples demonstrating the internal Python object model, including attribute access and special methods.
Distinct from Python Descriptors: Broadens from just descriptors to include the wider Python object model such as dunder methods and attribute lookup
Explore 2 awesome GitHub repositories matching software engineering & architecture · Object Model Implementations. Refine with filters or upvote what's useful.
该项目是一系列实用脚本和参考指南,展示了高级 Python 语言特性和惯用法。它提供了用于掌握并发、元编程和数据结构设计等概念的代码实现。 该存储库包括 Python 对象模型的示例,涵盖自定义属性访问、描述符协议和特殊方法重写。它还具有利用一等函数和装饰器来减少面向对象样板代码的设计模式实现。 该代码库涵盖了广泛的功能,包括使用事件循环和 Future 的异步编程、自定义序列和生成器的创建,以及使用抽象基类进行接口强制执行。它进一步展示了通过上下文管理器进行的资源管理以及对文本和字节序列的处理。
Code demonstrating custom attribute access, descriptor protocols, and special method overrides for Python objects.
CPython-Internals 是一个针对 CPython 解释器的技术实现指南和参考资料。它提供了对内部 C 源代码和架构的详细分析,重点关注控制解释器行为的逻辑。 该项目记录了 Python 对象模型和编译流水线,追踪从原始语法和抽象语法树(AST)到可执行字节码的过程。它还作为 C 扩展开发的参考,解释了如何与内部数据结构交互以及使用 C API。 该材料涵盖了内存管理,包括引用计数和分代垃圾回收,以及全局解释器锁(GIL)的功能。
Examines the low-level C implementation of the Python object model and internal data structures.