Glossary - 术语对照表 5

Glossary
https://docs.python.org/3.7/glossary.html

术语对照表
https://docs.python.org/zh-cn/3.7/glossary.html

1. generic function - 泛型函数

A function composed of multiple functions implementing the same operation for different types. Which implementation should be used during a call is determined by the dispatch algorithm.
为不同的类型实现相同操作的多个函数所组成的函数。在调用时会由调度算法来确定应该使用哪个实现。

See also the single dispatch glossary entry, the functools.singledispatch() decorator, and PEP 443.
另请参见 single dispatch 术语表条目、functools.singledispatch() 装饰器以及 PEP 443。

2. GIL

See global interpreter lock.
参见 global interpreter lock。

3. global interpreter lock - 全局解释器锁

The mechanism used by the CPython interpreter to assure that only one thread executes Python bytecode at a time. This simplifies the CPython implementation by making the object model (including critical built-in types such as dict) implicitly safe against concurrent access. Locking the entire interpreter makes it easier for the interpreter to be multi-threaded, at the expense of much of the parallelism afforded by multi-processor machines.
CPython 解释器所采用的一种机制,它确保同一时刻只有一个线程在执行 Python bytecode。此机制通过设置对象模型 (包括 dict 等重要内置类型) 针对并发访问的隐式安全简化了 CPython 实现。给整个解释器加锁使得解释器多线程运行更方便,其代价则是牺牲了在多处理器上的并行性。

However, some extension modules, either standard or third-party, are designed so as to release the GIL when doing computationally-intensive tasks such as compression or hashing. Also, the GIL is always released when doing I/O.
不过,某些标准库或第三方库的扩展模块被设计为在执行计算密集型任务如压缩或哈希时释放 GIL。此外,在执行 I/O 操作时也总是会释放 GIL。

Past efforts to create a free-threaded interpreter (one which locks shared data at a much finer granularity) have not been successful because performance suffered in the common single-processor case. It is believed that overcoming this performance issue would make the implementation much more complicated and therefore costlier to maintain.
创建一个 (以更精细粒度来锁定共享数据的) 自由线程解释器的努力从未获得成功,因为这会牺牲在普通单处理器情况下的性能。据信克服这种性能问题的措施将导致实现变得更复杂,从而更难以维护。

4. hash-based pyc - 基于哈希的 pyc

A bytecode cache file that uses the hash rather than the last-modified time of the corresponding source file to determine its validity. See Cached bytecode invalidation.
使用对应源文件的哈希值而非最后修改时间来确定其有效性的字节码缓存文件。参见已缓存字节码的失效。

5. hashable - 可哈希

An object is hashable if it has a hash value which never changes during its lifetime (it needs a __hash__() method), and can be compared to other objects (it needs an __eq__() method). Hashable objects which compare equal must have the same hash value.
一个对象的哈希值如果在其生命周期内绝不改变,就被称为可哈希 (它需要具有 __hash__() 方法),并可以同其他对象进行比较 (它需要具有 __eq__() 方法)。可哈希对象必须具有相同的哈希值比较结果才会相同。

Hashability makes an object usable as a dictionary key and a set member, because these data structures use the hash value internally.
可哈希性使得对象能够作为字典键或集合成员使用,因为这些数据结构要在内部使用哈希值。

Most of Python’s immutable built-in objects are hashable; mutable containers (such as lists or dictionaries) are not; immutable containers (such as tuples and frozensets) are only hashable if their elements are hashable. Objects which are instances of user-defined classes are hashable by default. They all compare unequal (except with themselves), and their hash value is derived from their id().
大多数 Python 中的不可变内置对象都是可哈希的,可变容器 (例如列表或字典) 都不可哈希,不可变容器 (例如元组和 frozenset) 仅当它们的元素均为可哈希时才是可哈希的。用户定义类的实例对象默认是可哈希的。它们在比较时一定不相同 (除非是与自己比较),它们的哈希值的生成是基于它们的 id()。

6. IDLE

An Integrated Development Environment for Python. IDLE is a basic editor and interpreter environment which ships with the standard distribution of Python.
Python 的 IDE 是集成开发与学习环境的英文缩写,是 Python 标准发行版附带的基本编程器和解释器环境。

7. immutable - 不可变

An object with a fixed value. Immutable objects include numbers, strings and tuples. Such an object cannot be altered. A new object has to be created if a different value has to be stored. They play an important role in places where a constant hash value is needed, for example as a key in a dictionary.
具有固定值的对象。不可变对象包括数字、字符串和元组。这样的对象不能被改变。如果必须存储一个不同的值,则必须创建新的对象。它们在需要常量哈希值的地方起着重要作用,例如作为字典中的键。

8. import path - 导入路径

A list of locations (or path entries) that are searched by the path based finder for modules to import. During import, this list of locations usually comes from sys.path, but for subpackages it may also come from the parent package’s __path__ attribute.
由多个位置 (或路径条目) 组成的列表,会被模块的 path based finder 用来查找导入目标。在导入时,此位置列表通常来自 sys.path,但对次级包来说也可能来自上级包的 __path__ 属性。

9. importing - 导入

The process by which Python code in one module is made available to Python code in another module.
令一个模块中的 Python 代码能为另一个模块中的 Python 代码所使用的过程。

10. importer - 导入器

An object that both finds and loads a module; both a finder and loader object.
查找并加载模块的对象,此对象既属于 finder 又属于 loader。

Glossary - 术语对照表 5相关推荐

  1. Glossary - 术语对照表 4

    Glossary - 术语对照表 4 Glossary https://docs.python.org/3.7/glossary.html 术语对照表 https://docs.python.org/ ...

  2. Glossary - 术语对照表 2

    Glossary - 术语对照表 2 Glossary https://docs.python.org/3.7/glossary.html 术语对照表 https://docs.python.org/ ...

  3. Glossary - 术语对照表 1

    Glossary - 术语对照表 1 Glossary https://docs.python.org/3.7/glossary.html 术语对照表 https://docs.python.org/ ...

  4. Glossary - 术语对照表 10

    Glossary - 术语对照表 10 Glossary https://docs.python.org/3.7/glossary.html 术语对照表 https://docs.python.org ...

  5. Glossary - 术语对照表 8

    Glossary - 术语对照表 8 Glossary https://docs.python.org/3.7/glossary.html 术语对照表 https://docs.python.org/ ...

  6. Glossary - 术语对照表 3

    Glossary - 术语对照表 3 Glossary https://docs.python.org/3.7/glossary.html 术语对照表 https://docs.python.org/ ...

  7. Glossary - 术语对照表 9

    Glossary - 术语对照表 9 Glossary https://docs.python.org/3.7/glossary.html 术语对照表 https://docs.python.org/ ...

  8. Glossary - 术语对照表 6

    Glossary - 术语对照表 6 Glossary https://docs.python.org/3.7/glossary.html 术语对照表 https://docs.python.org/ ...

  9. Glossary - 术语对照表 7

    Glossary - 术语对照表 7 Glossary https://docs.python.org/3.7/glossary.html 术语对照表 https://docs.python.org/ ...

最新文章

  1. Python学习笔记 - PostgreSQL的使用
  2. python stm32-STM32 上面跑Python
  3. 管能做暖气管道吗_这样的暖气管道施工,标准吗
  4. 重磅 CV、NLP 算法赛,科大讯飞2020 A.I.开发者大赛正式启动!
  5. C语言购物篮解题思路,大型超购物篮问题分析数学建模.doc
  6. LayUI中select下拉框选中触发事件
  7. python卸载指令_如何卸载python插件
  8. 亚马逊吸尘器需要提交UL1017测试报告,亚马逊要求提供ISO17025资质机构出具的UL报告
  9. 学习【阿里巴巴Java开发手册-嵩山版】
  10. 三菱FX系列PLC教程
  11. JS中的curry化(柯里化)
  12. 计算机excel表格教程高级筛选6,excel表格中的高级筛选要怎么操作?
  13. latex中report目录_latex系列--2 标题、章节、目录、标签、引用
  14. 期货市场十赌九输,钱都去哪里了?
  15. 人脸识别支付欺诈手段和防范措施
  16. U盘制作ubuntu18.04.6系统安装盘
  17. 商务谈判Business Negotiation
  18. Byte 高位/低位简介绍(大端格式/小端格式)
  19. Unity制作2D战棋小游戏
  20. [bzoj1502]月下柠檬树

热门文章

  1. ISO9001内审员需要知道的内容分享
  2. hadoop连接mysql_Hadoop 连接mysql
  3. js自动触发点击事件
  4. PasswordEncrypted
  5. 计算机键盘分区,电脑初学者必看键盘五个分区功能知识.doc
  6. T1042/T2080 U-BOOT 移植阶段(四)调试网口问题不通解决
  7. bash中文手册在线pdf
  8. 替换XP的系统字体为Vista的Segoe UI字体的较完美方法
  9. 光模块SFF协议的下载地址
  10. 上海交通大学c语言程序设计考试,2016年华东交通大学软件学院C语言程序设计考研复试题库...