Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有使用更高级别的 Python 构造的最佳实践,例如threading.Condition, 以及collections.deque用 C 编写的模块?尤其是:
threading.Condition
collections.deque
字典上的字符串查找在 Python 中非常便宜,但如果需要,您可以将它们缓存在结构中。
通常没有这样做的规定,因为这些库是通过 Python 而不是 C 访问的。仍然可以生成您自己的与 C 模块中的定义匹配的头文件,但它们需要按 Python 维护版本。
这个没有好答案。它归结为“快”与“足够快”。