Glossary - 术语对照表 4

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

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

1. expression - 表达式

A piece of syntax which can be evaluated to some value. In other words, an expression is an accumulation of expression elements like literals, names, attribute access, operators or function calls which all return a value. In contrast to many other languages, not all language constructs are expressions. There are also statements which cannot be used as expressions, such as while. Assignments are also statements, not expressions.
可以求出某个值的语法单元。换句话说,一个表达式就是表达元素例如字面值、名称、属性访问、运算符或函数调用的汇总,它们最终都会返回一个值。与许多其他语言不同,并非所有语言构件都是表达式。还存在不能被用作表达式的 statement,例如 while。赋值也是属于语句而非表达式。

2. extension module - 扩展模块

A module written in C or C++, using Python’s C API to interact with the core and with user code.
以 C 或 C++ 编写的模块,使用 Python 的 C API 来与语言核心以及用户代码进行交互。

3. f-string - f-字符串

String literals prefixed with ‘f’ or ‘F’ are commonly called “f-strings” which is short for formatted string literals. See also PEP 498.
带有 ‘f’ 或 ‘F’ 前缀的字符串字面值通常被称为“f-字符串”即格式化字符串字面值的简写。参见 PEP 498。

4. file object - 文件对象

An object exposing a file-oriented API (with methods such as read() or write()) to an underlying resource. Depending on the way it was created, a file object can mediate access to a real on-disk file or to another type of storage or communication device (for example standard input/output, in-memory buffers, sockets, pipes, etc.). File objects are also called file-like objects or streams.
对外提供面向文件 API 以使用下层资源的对象 (带有 read() 或 write() 这样的方法)。根据其创建方式的不同,文件对象可以处理对真实磁盘文件,对其他类型存储,或是对通讯设备的访问 (例如标准输入/输出、内存缓冲区、套接字、管道等等)。文件对象也被称为文件类对象或流。

There are actually three categories of file objects: raw binary files, buffered binary files and text files. Their interfaces are defined in the io module. The canonical way to create a file object is by using the open() function.
实际上共有三种类别的文件对象:原始二进制文件、缓冲二进制文件以及文本文件。它们的接口定义均在 io 模块中。创建文件对象的规范方式是使用 open() 函数。

5. file-like object - 文件类对象

A synonym for file object.

synonym ['sɪnənɪm]:n. 同义词,同义字

6. finder - 查找器

An object that tries to find the loader for a module that is being imported.
一种会尝试查找被导入模块的 loader 的对象。

Since Python 3.3, there are two types of finder: meta path finders for use with sys.meta_path, and path entry finders for use with sys.path_hooks.
从 Python 3.3 起存在两种类型的查找器:元路径查找器,配合 sys.meta_path 使用,以及 path entry finders 配合 sys.path_hooks 使用。

See PEP 302, PEP 420 and PEP 451 for much more detail.

7. function - 函数

A series of statements which returns some value to a caller. It can also be passed zero or more arguments which may be used in the execution of the body. See also parameter, method, and the Function definitions section.
可以向调用者返回某个值的一组语句。还可以向其传入零个或多个参数,并在函数体执行中被使用。另见 parameter, method 和函数定义等节。

8. function annotation - 函数注释

An annotation of a function parameter or return value.
即针对函数形参或返回值的 annotation。

Function annotations are usually used for type hints: for example, this function is expected to take two int arguments and is also expected to have an int return value:
函数注释通常用于类型提示:例如以下函数预期接受两个 int 参数并预期返回一个 int 值:

def sum_two_numbers(a: int, b: int) -> int:return a + b

Function annotation syntax is explained in section Function definitions.
函数注释语法的详解见函数定义一节。

See variable annotation and PEP 484, which describe this functionality.

hint [hɪnt]:n. 暗示,线索 vt. 暗示,示意 vi. 示意

9. generator - 生成器

A function which returns a generator iterator. It looks like a normal function except that it contains yield expressions for producing a series of values usable in a for-loop or that can be retrieved one at a time with the next() function.
返回一个 generator iterator 的函数。它看起来很像普通函数,不同点在于其包含 yield 表达式以便产生一系列值供给 for-循环使用或是通过 next() 函数逐一获取。

Usually refers to a generator function, but may refer to a generator iterator in some contexts. In cases where the intended meaning isn’t clear, using the full terms avoids ambiguity.
通常是指生成器函数,但在某些情况下也可能是指生成器迭代器。如果需要清楚表达具体含义,请使用全称以避免歧义。

10. generator iterator - 生成器迭代器

An object created by a generator function.
generator 函数所创建的对象。

Each yield temporarily suspends processing, remembering the location execution state (including local variables and pending try-statements). When the generator iterator resumes, it picks up where it left off (in contrast to functions which start fresh on every invocation).
每个 yield 会临时暂停处理,记住当前位置执行状态 (包括局部变量和挂起的 try 语句)。当该生成器迭代器恢复时,它会从离开位置继续执行 (这与每次调用都从新开始的普通函数差别很大)。

11. generator expression - 生成器表达式

An expression that returns an iterator. It looks like a normal expression followed by a for clause defining a loop variable, range, and an optional if clause. The combined expression generates values for an enclosing function:
返回一个迭代器的表达式。它看起来很像普通表达式后面带有定义了一个循环变量、范围的 for 子句,以及一个可选的 if 子句。以下复合表达式会为外层函数生成一系列值:

>>> sum(i*i for i in range(10))  # sum of squares 0, 1, 4, ... 81
285

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

  1. Glossary - 术语对照表 5

    Glossary - 术语对照表 5 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. 爱奇艺火爆的背后,个性化推荐排序是如何配合的?
  2. 【阿里云课程】如何从零开始完成第一个GAN项目
  3. 分布式系统——zabbix监控tomcat
  4. RTMPdump(libRTMP) 源代码分析 6: 建立一个流媒体连接 (NetStream部分 1)
  5. Javascript ECMA-3 (数组,Date,正则)
  6. python进程池_python进程池剖析(一)
  7. 如果一栋楼起火谁赔偿_太原一辆快递车起火!赶紧看看有你的包裹没?
  8. 2 年 6 个月 11 天,外包到阿里的修仙之路!| 原力计划
  9. 【致青春】我们挥霍时间的年代
  10. 转:给.net 程序员的一些建设
  11. oracle 创建数组
  12. 计算机组装的虚拟仿真实验报告,组装计算机的虚拟实验室
  13. 电力系统通信与网络技术/智能变电站个人总结
  14. python 发送邮件正文字体设置_python 发送邮件
  15. C语言 分数加减运算
  16. 两阶段最小二乘法TSLS案例分析
  17. pytorch学习笔记7--循环神经网络、GAN
  18. linux中查看磁盘配额的数量,[Linux实用命令]-11-磁盘配额实例详解
  19. 关于Android 8.0/9.0 之后获取wifi名称为空的解决方法
  20. 自动焊锡机加锡时的注意事项

热门文章

  1. 至最近写的微博记录(一)
  2. 关于手机蓝牙pos机刷卡问题
  3. i5 9300h怎么样
  4. (七) Docker安装常规软件
  5. ajax的跨域请求实现,Ajax-07 基于Ajax实现跨域请求(示例代码)
  6. IntelliJ IDEA 详细图解 svn merge 分支合并主干,主干合并分支,都是merge一个套路
  7. 疟原虫感染治疗癌症,灵感竟然来源于地图
  8. python中的关键词final_在Python中,将列表中的关键字与一行单词相匹配
  9. 医院电脑验光单各参数解释
  10. RK3568平台开发系列讲解(系统优化篇)常见CPU性能问题