Python-009-Classes
出自
1
3.12.5 Documentation » The Python Tutorial » 9. Classes
attribute
“Attribute” 这个词在英文中可以作为名词和动词使用,具体用法如下:
作为名词
特性/属性: 指某事物的特性或性质。
- 例句: “Honesty is a valuable attribute in a leader.” (诚实是领导者宝贵的品质。)
属性: 在技术或计算机科学中,指的是数据或对象的特征。
- 例句: “The
color
attribute of the CSS rule changes the text color.” (CSS 规则中的color
属性改变了文本颜色。)作为动词
归因于: 表示某事物是由某人或某事物造成的。
- 例句: “She attributes her success to hard work and dedication.” (她把自己的成功归因于努力工作和奉献。)
赋予: 赋予某个特征或品质。
- 例句: “The new design attributes a sleek look to the device.” (新设计赋予了设备一种流线型的外观。)
Each class instance can have attributes attached to it for maintaining its state.
derive
“Derive” 这个词也可以作为动词和名词使用,但最常见的是作为动词。它的基本含义是“得到”或“推导出”,具体用法如下:
作为动词
推导: 从已知的信息或公式中推导出新的信息或结论。
- 例句: “We can derive the formula by using algebraic principles.” (我们可以通过使用代数原理推导出这个公式。)
获得: 从某个来源或基础中得到某物。
- 例句: “The word ‘photography’ is derived from Greek roots meaning ‘light’ and ‘writing.’” (单词“photography”源自希腊语,意思是“光”和“书写”。)
引申: 从某种情况或条件中获得某种结果或影响。
- 例句: “She derives great pleasure from reading classic literature.” (她从阅读经典文学中获得了极大的乐趣。)
作为名词
- 派生物: 在某些上下文中,“derive” 可以作为名词,指从某个事物中派生出的东西(尽管这种用法不如动词形式常见)。
“Derive” 常用于学术、数学、科学和语言学等领域。在具体上下文中,它通常指通过逻辑推导或源头获取信息或结果。
the class inheritance mechanism allows multiple base classes, a derived class can override any methods of its base class or classes, and a method can call the method of a base class with the same name.
partake
“Par take” 是一个动词,意味着参与或分享某种活动、经验或资源。它的用法可以分为以下几种:
作为动词
参与: 参与某种活动或事件。
- 例句: “She decided to partake in the charity event.” (她决定参与这个慈善活动。)
分享: 共享某物,尤其是食物或饮料。
- 例句: “We all partook of the delicious meal prepared by the chef.” (我们都分享了由厨师准备的美味餐点。)
体验: 体验或感受某种情感或状态。
- 例句: “He partook of the joy of the celebration.” (他体验到了庆祝活动的喜悦。)
常见短语
Partake in: 参与某活动。
- 例句: “The students will partake in a science fair next week.” (学生们将参加下周的科学展览。)
Partake of: 分享或享用食物或饮料。
- 例句: “They partook of a feast in honor of the festival.” (他们共享了一顿盛宴以庆祝节日。)
这个词在正式或文学性的表达中较为常见
As is true for modules, classes partake of the dynamic nature of Python: they are created at runtime, and can be modified further after creation.
与模块一样,类具有 Python 的动态特性:它们在运行时创建,并且可以在创建后进一步修改。
shorthand
速记,缩写,简略的表达方式
来自 short,短的,缩写的,hand,手,书写。比较 longhand.
there are no shorthands for referencing the object’s members from its methods
没有从对象的方法引用对象成员的简写
trick
文中表示 技巧/窍门 的意思
“Trick” 是一个多义词,根据上下文可以有不同的含义。它可以作为名词和动词使用,具体用法如下:
作为名词
把戏/戏法: 一种技巧性展示或欺骗性的表演,通常用于娱乐。
- 例句: “The magician performed an impressive trick with cards.” (魔术师表演了一场令人印象深刻的纸牌把戏。)
诡计/欺骗: 一种欺骗或误导他人的手段。
- 例句: “He used a trick to get out of paying the bill.” (他用了一个诡计来避免支付账单。)
窍门/小技巧: 一种技巧或方法,用于简化任务或解决问题。
- 例句: “Here’s a trick to make your Excel work easier.” (这是一个让你在 Excel 中工作更轻松的小技巧。)
恶作剧: 一种轻松的、通常不造成伤害的玩笑或捉弄。
- 例句: “They played a trick on their friend by hiding his phone.” (他们通过藏起朋友的手机来捉弄他。)
作为动词
欺骗: 使某人相信不真实的事情或误导他们。
- 例句: “She tricked him into believing she was a famous actress.” (她欺骗他相信她是一个著名演员。)
捉弄: 对某人进行恶作剧或开玩笑。
- 例句: “The kids tricked their teacher on April Fool’s Day.” (孩子们在愚人节捉弄了他们的老师。)
常见短语
Pull a trick: 实施一个恶作剧或骗局。
- 例句: “He pulled a trick on his colleagues by pretending to be sick.” (他假装生病来捉弄他的同事。)
Trick of the trade: 行业或领域中的特定技巧或窍门。
- 例句: “Learning the trick of the trade can make you more efficient at your job.” (掌握行业中的技巧可以使你在工作中更高效。)
Play a trick on: 对某人施加恶作剧或戏弄。
- 例句: “They played a trick on their neighbor by putting fake spiders in his mailbox.” (他们通过在邻居的邮箱里放假蜘蛛来捉弄他。)
Class definitions play some neat tricks with namespaces
类定义对命名空间发挥了一些巧妙的作用
Incidentally
/ˌɪnsɪˈdent(ə)li/
adv.顺便说一句;偶然地;附带地,伴随地
“Incidentally” 通常用来引入一个与当前讨论相关但不是主要重点的附带信息。
它的语气可以是轻松的,有时也带有一些偶然的感觉。
Incidentally, knowledge about this subject is useful for any advanced Python programmer.
invocation
来自
invoke
文中表示调用的意思
通常用于指代请求、呼唤或启用某种力量、神祇或原则的行为
the local names in a function invocation.
函数调用中的本地名称。
In a sense
“In a sense” 是一个短语,用来表示某种意义上、在某种程度上或从某种角度来看。
form
“Form” 是一个多义词,既可以作为名词也可以作为动词使用。它在不同的上下文中有不同的含义和用法。以下是“form”的主要用法:
作为名词
形式/形状: 指事物的外观、形态或结构。
- 例句: “The sculpture takes the form of a human figure.”
(这件雕塑呈现出人形的形式。)表格: 用于填写信息的文件或纸张。
- 例句: “Please fill out this form with your personal details.”
(请填写这张表格上的个人信息。)形式/类型: 指某事物的类别或种类。
- 例句: “Poetry is a form of artistic expression.”
(诗歌是一种艺术表达的形式。)体能/状态: 指人的健康状况或表现。
- 例句: “She is in great form for the upcoming match.”
(她为即将到来的比赛状态良好。)作为动词
形成/塑造: 使某物形成特定的形状或结构。
- 例句: “The artist forms the clay into beautiful shapes.”
(艺术家将粘土塑造成美丽的形状。)建立/组成: 创建或建立某种组织、团体或结构。
- 例句: “They formed a new committee to address the issue.”
(他们成立了一个新委员会来解决这个问题。)表现/显现: 表现出某种特征或状态。
- 例句: “A plan began to form in her mind.”
(一个计划开始在她的脑海中形成。)常见短语
In the form of: 以…的形式。
- 例句: “The assistance came in the form of financial support.”
(帮助以经济支持的形式提供。)Form a habit: 养成习惯。
- 例句: “It takes time to form a new habit.”
(养成一个新习惯需要时间。)Form an opinion: 形成观点。
- 例句: “You should gather all the facts before you form an opinion.”
(你应该在形成观点之前收集所有事实。)Fill out a form: 填写表格。
- 例句: “Make sure to fill out the form completely before submitting it.”
(提交之前,请确保完整填写表格。)
In a sense the set of attributes of an object also form a namespace.
从某种意义上说,对象的属性集也形成了命名空间。
region
表示特定的 领域, 区域 或者范围
In the region of: 表示“大约、接近”某个数值或范围。
- 例句: “The cost of the project is in the region of $1 million.”
(该项目的成本大约为一百万美元。)Regional: 形容词形式,表示“区域的”或“地方的”。
- 例句: “They attended a regional conference on climate change.”
(他们参加了一个关于气候变化的区域会议。)Economic region: 经济区域,指在经济活动上有一定关联的地理区域。
- 例句: “The European Union functions as a single economic region.”
(欧盟作为一个统一的经济区域运作。)
A scope is a textual region of a Python program where a namespace is directly accessible.
作用域是 Python 程序的文本区域,其中的命名空间可直接访问。
qualify
/ˈkwɑːlɪfaɪ/
词根词缀: -qual-性质,特征 + -ify动词词尾
“Qualify” 可以表示获得某种资格、使有资格、限定某事物的范围,或在语法中修饰词语。
文中是指
限定
的意思
作为动词
- 获得资格/符合条件: 指通过考试、比赛或某种条件测试,达到某种标准或资格。
- 例句: “She qualified for the final round of the competition.”
(她获得了进入比赛决赛的资格。)- 使有资格: 表示使某人具备某种资格或能力。
- 例句: “This course will qualify you to teach English abroad.”
(这个课程将使你具备在国外教英语的资格。)- 限定/修饰: 用来限制或修饰某个陈述,表示其有效范围或程度。
- 例句: “I would qualify my statement by saying it applies only to certain situations.”
(我会限定我的说法,表示它只适用于某些情况。)- 限定(词语语法功能): 在语法中,表示某个词修饰另一个词,使其含义更具体。
- 例句: “In the sentence ‘a very good book,’ the word ‘very’ qualifies ‘good’.”
(在句子“a very good book”中,单词“very”修饰了“good”。)常见短语
- Qualify for: 符合条件,有资格做某事。
- 例句: “He didn’t qualify for the scholarship because his grades weren’t high enough.”
(他的成绩不够高,所以没有资格获得奖学金。)- Qualify as: 成为,具备某种资格或称号。
- 例句: “She qualified as a doctor after seven years of study.”
(经过七年的学习,她成为了一名医生。)- Qualify a statement: 修饰或限制一个陈述。
- 例句: “He qualified his praise by mentioning a few areas of improvement.”
(他在赞扬的同时提到了一些需要改进的地方。)
“Directly accessible” here means that an unqualified reference to a name attempts to find the name in the namespace.
这里的“直接访问”意味着对名称的非限定引用尝试在名称空间中查找该名称。
next-to-last
倒数第二个
identically
adv.同一地;相等地
identical + -ly
词根词缀: -ident-相同,同一 + -ical性状
leaving the identically named outer variable unchanged
保持同名的外部变量不变
quirk
/kwɜːrk/
“Quirk” 是一个名词,通常用于描述某人的性格、行为或事物中与众不同、古怪的特点或习惯。它通常指的是一种轻微的、奇特的、与众不同的特征,往往带有一点幽默或正面的意思。以下是“quirk”的主要用法:
用法和例子
古怪的性格或习惯: 指一个人独特、与众不同的小习惯或性格特征。
- 例句: “He has a quirky habit of talking to his plants every morning.”
(他有一个古怪的习惯,每天早上都和他的植物说话。)- 这里的“quirky”表示一种有趣而不寻常的行为。
事物的奇特特点: 指事物或事件中出乎意料或奇特的方面。
- 例句: “The house has a few quirks, like the secret passage behind the bookshelf.”
(这座房子有一些奇怪的地方,比如书架后面的秘密通道。)- 在这个例子中,“quirks” 指的是房子中的特殊、不寻常的特点。
出乎意料的转折/巧合: 在某些情况下,“quirk” 也可以用来描述一个意外的、出乎意料的事件或转折。
- 例句: “By a strange quirk of fate, they ended up meeting again years later.”
(通过命运的奇特转折,他们几年后又见面了。)- 这里“quirk of fate”表示命运的一个不寻常的转折。
常见短语
Quirk of fate: 指命运的奇怪转折,通常表示一种不可预见或出人意料的情况。
- 例句: “It was a quirk of fate that they both chose the same university.”
(他们俩都选择了同一所大学是命运的奇怪安排。)Quirky: 形容词形式,表示“古怪的”、“有趣的”。
- 例句: “She has a quirky sense of fashion that makes her stand out.”
(她的时尚风格很古怪,让她很突出。)小结
“Quirk” 主要用于形容人、事物或命运中的古怪特征或行为,通常带有轻松、幽默的色彩。它可以用来形容个性、建筑特点,或者是命运中的巧合。如果你有具体的例子或上下文需要帮助解释,请告诉我!
A special quirk of Python is that – if no global
or nonlocal
statement is in effect – assignments to names always go into the innermost scope.
Python 的一个特殊之处是,如果没有有效的全局或非局部语句,对名称的赋值总是进入最内层的作用域。
have effect
“Have effect” 是一个短语,表示某个行动、决定、政策或条件产生了效果或影响。通常用于讨论某事物是否对某个情况或结果产生了实际的作用。以下是关于它的常见用法和例子:
用法和例子
- 产生影响: 指某个行为或事件对结果或情况有实际影响。
- 例句: “The new law will have an effect on businesses across the country.”
(这项新法律将对全国的企业产生影响。)- 产生积极或消极的效果: 可以用来描述某个行动的正面或负面结果。
- 例句: “His speech had a powerful effect on the audience.”
(他的演讲对听众产生了强烈的影响。)- 表示生效: 可以用来说明某个协议、规定或法律开始生效。
- 例句: “The new regulations will have effect starting next month.”
(新规将从下个月开始生效。)常见短语
- Take effect: 另一个常用短语,表示某事物开始产生效果或作用。
- 例句: “The medication will take effect in about 30 minutes.”
(药物将在大约30分钟后开始起效。)- Have no effect: 表示某事物没有产生预期的效果或作用。
- 例句: “The changes had no effect on improving the system’s performance.”
(这些变化对改善系统性能没有影响。)- Have an immediate effect: 表示立即产生影响或作用。
- 例句: “The new marketing strategy had an immediate effect on sales.”
(新的营销策略对销售产生了立竿见影的效果。)
Class definitions, like function definitions (def
statements) must be executed before they have any effect.
类定义与函数定义(def 语句)一样,必须先执行才能生效。
conceive
/kənˈsiːv/
词根词缀: con-共同 + -ceiv-拿 + -e → 收到一起,构成一物
“Conceive” 是一个动词,具有多种含义,通常用于表达某种思想或计划的产生、理解某个概念,或者在生物学中指怀孕。以下是它的主要用法和例子:
用法和例子
- 构思/设想: 表示形成一个想法、计划或概念,尤其是当某个创意、计划在脑海中产生时。
- 例句: “The architect conceived the design for the new museum.”
(建筑师构思了新博物馆的设计。)- 想象/理解: 表示能够理解某种想法或情况,通常用于表示某事很难想象或理解。
- 例句: “I cannot conceive how they managed to solve such a complex problem.”
(我无法想象他们是如何解决这么复杂的问题的。)- 怀孕: 在生物学上,表示怀上孩子的过程。
- 例句: “She conceived after many years of trying to have a child.”
(她在多年的努力后终于怀孕了。)常见短语
- Conceive of: 用于描述设想或想象某事物,表示“想象到”或“设想到”。
- 例句: “He could not conceive of a world without technology.”
(他无法想象没有科技的世界。)- Conceive a plan/idea: 表示构思或制定计划。
- 例句: “They conceived a brilliant plan to increase sales.”
(他们构思了一个提高销售的绝妙计划。)- Conceive a child: 表示怀孕。
- 例句: “The couple was thrilled when they conceived their first child.”
(这对夫妻在怀上他们的第一个孩子时欣喜若狂。)
You could conceivably place a class definition in a branch of an if
statement, or inside a function.
您可以将类定义放置在 if 语句的分支中或函数内部。
peculiar
/pɪˈkjuːliər/
“Peculiar” 是一个形容词,表示某事物与众不同、奇特或独特,通常带有不同寻常的或奇怪的含义。以下是它的主要用法和例子:
用法和例子
- 奇怪的/不寻常的: 用来描述某事物的行为、外观、特征等不同于正常或常规的情况,常常带有“奇怪”或“异样”的含义。
- 例句: “There was a peculiar smell in the room that no one could identify.”
(房间里有一种奇怪的气味,没人能说清楚是什么。)- 独特的/特有的: 表示某人或某物拥有独特的、只属于自己的特征。
- 例句: “This plant is peculiar to the tropical regions.”
(这种植物是热带地区所特有的。)- 奇特的性格或行为: 描述某人有独特、古怪的性格或行为习惯。
- 例句: “She has a peculiar way of laughing that makes everyone smile.”
(她有一种独特的笑声,总是让人发笑。)常见短语
- Peculiar to: 用来表示某事物对某人或某地特有,常指独特的现象或特征。
- 例句: “This accent is peculiar to people from that region.”
(这种口音是那个地区的人所特有的。)- Something peculiar about: 用来描述某事物让人感到奇怪或异常。
- 例句: “There is something peculiar about the way he talks.”
(他讲话的方式有些奇怪。)“Peculiar” 可以用来描述某人或事物的独特、奇怪、不寻常的特征,既可以是贬义的“奇怪”,也可以是中性或正面的“独特”。
The function definitions inside a class normally have a peculiar form of argument list
类内的函数定义通常具有特殊形式的参数列表
spring into
这里 spring 作为动词使用 表示 弹跳 突然之意
“Spring into” 是一个动词短语,通常用来表示突然、迅速地进入某种状态或行动。它常常用于描述迅速或突然的变化,尤其是在开始做某事时。以下是它的主要用法和例子:
用法和例子
- 迅速进入/开始做某事: 表示立即或迅速地开始某项活动或行动。
- 例句: “As soon as the alarm went off, everyone sprang into action.”
(一旦警报响起,大家立刻采取行动。)- 在这个例子中,“spring into action” 表示迅速开始行动。
- 迅速进入某种状态: 表示突然进入或变成某种状态。
- 例句: “The city sprang into life as the sun rose and people began their daily routines.”
(随着太阳升起,城市迅速活跃起来,人们开始了日常活动。)- 这里的“spring into life” 表示城市突然变得充满活力。
常见短语
- Spring into action: 表示迅速开始行动或做准备。
- 例句: “When the emergency occurred, the rescue team sprang into action.”
(当紧急情况发生时,救援队迅速展开行动。)- Spring into being: 表示某事物突然或迅速出现或形成。
- 例句: “New businesses sprang into being as the local economy improved.”
(随着当地经济的改善,新企业迅速出现。)
they spring into existence when they are first assigned to.
它们在第一次被分配时就出现了
trace
“Trace” 可以作为名词和动词使用,具有不同的含义和用法,具体取决于上下文。
作为动词 (Verb)
追踪、跟踪:
- To find someone or something by following clues or signs.
- 例子:
- The police tried to trace the call to find the suspect.(警察试图追踪电话以找到嫌疑人。)
- I can trace my family history back to the 19th century.(我可以追溯我的家族历史到19世纪。)
描摹、临摹:
- To copy or draw over something by following its outline.
- 例子:
- The children were taught how to trace letters.(孩子们被教如何描字母。)
查明原因、来源:
- To discover the origin or development of something.
- 例子:
- The problem can be traced to a software bug.(问题可以追溯到一个软件漏洞。)
作为名词 (Noun)
痕迹、踪迹:
- A small sign that shows something was present or existed.
- 例子:
- There was no trace of the missing hiker.(失踪的登山者没有留下任何踪迹。)
- She disappeared without a trace.(她消失得无影无踪。)
极少量:
- A very small amount of something.
- 例子:
- The food contained trace amounts of nuts.(这食物中含有微量的坚果。)
常见搭配:
- Trace back to: 追溯到
- Leave a trace: 留下痕迹
- Without a trace: 毫无踪迹
根据上下文,“trace” 可以表示追踪、查找来源、或者是指某种痕迹或微量物质。
prioritize
/praɪˈɔːrətaɪz/
来自priority,优先权,-ize,使。
priority
词根词缀: -pri-首要 + -or形容词词尾,较…的 + -ity名词后缀
“Prioritize” 是一个动词,表示优先处理或将某事放在首要位置。它通常用于表示在多个任务或目标中,决定哪些需要先完成,哪些可以推后。以下是一些常见的用法和例句:
1. 优先处理某事:
- Prioritize + noun(优先处理某项任务、活动等)
- 例子:
- We need to prioritize customer satisfaction.(我们需要优先考虑客户满意度。)
- It’s important to prioritize your health.(优先照顾好自己的健康很重要。)
2. 根据重要性进行排序:
- Prioritize tasks/goals(根据任务或目标的重要性进行排序)
- 例子:
- You should prioritize your tasks based on their deadlines.(你应该根据任务的截止日期来确定优先级。)
- I always prioritize my most difficult assignments.(我总是优先处理最困难的任务。)
3. 用于反身结构:
- Prioritize yourself(照顾好自己)
- 例子:
- You need to prioritize yourself sometimes.(有时候你需要优先考虑自己。)
4. 优先权的概念:
- Prioritize + noun (for)(为了某种目的优先处理)
- 例子:
- We should prioritize resources for urgent projects.(我们应该优先为紧急项目分配资源。)
常见短语:
- Prioritize over: 优先于……
- 例子:Work is often prioritized over family time.(工作通常优先于家庭时间。)
“Prioritize” 通常用于需要管理时间、资源或精力的场合,帮助确定哪些事情最为重要并优先完成。
If the same attribute name occurs in both an instance and in a class, then attribute lookup prioritizes the instance:
如果相同的属性名称同时出现在实例和类中,则属性查找会优先考虑实例:
invariant
/ɪnˈveriənt/
adj.不变的
n.[数] 不变量;[计] 不变式
variant
n.变种,变形;(单词拼写或读音的)变异,变体
adj.不同的,变体的,变种的
clients may mess up invariants
客户可能会弄乱不变量
stamp
邮戳,有批准,标记的意思,比如皇帝的印章 盖在圣旨上面
the methods by stamping on their data attributes
通过标记其数据属性来实现方法
confuse
“Confuse” 是一个动词,表示使困惑或使混淆。它用于描述一个人感到不清楚、无法理解某事,或是把两个或多个事物搞混。以下是一些常见的用法和例子:
1. 使困惑:
- To make someone unable to think clearly or understand something.
- 例子:
- The instructions on the form confused me.(表格上的说明让我感到困惑。)
- His explanation only confused the situation more.(他的解释反而让情况更加复杂。)
2. 混淆、搞错:
- To mistake one thing for another, or not be able to distinguish between similar things.
- 例子:
- I always confuse John with his brother because they look so alike.(我总是把约翰和他的兄弟搞混,因为他们长得太像了。)
- Don’t confuse experience with intelligence.(不要把经验和智力混为一谈。)
3. 使复杂化:
- To make a situation or problem more complicated or difficult to understand.
- 例子:
- Adding too many variables can confuse the results.(加入太多变量可能会使结果复杂化。)
常见短语:
Confuse with: 把某物与另一物混淆
- 例子:He often confuses fiction with reality.(他常常把虚构和现实混为一谈。)
Be confused about: 对某事感到困惑
- 例子:She is confused about what to do next.(她对接下来该做什么感到困惑。)
“Confuse” 可以用来表达认知上的混乱或情感上的困惑,并且经常用于说明人在面对复杂或模糊情况时的反应。
there is no chance of confusing local variables and instance variables when glancing through a method.
当浏览一个方法时,不会混淆局部变量和实例变量。
conceivable
adj.可想象的,可相信的
conceive /kənˈsiːv/
v.构思,设想;使受孕,怀孕
it is also conceivable that a class browser program might be written that relies upon such a convention.
还可以想象,可以编写依赖于这种约定的类浏览器程序。
In place of
“In place of” 是一个介词短语,意思是“代替”或“替换”,表示用某物或某人替代另一物或人。这个短语常用于替换、交换或代替某个东西的情境。
“In place of” 是一个介词短语,意思是“代替”或“替换”,表示用某物或某人替代另一物或人。这个短语常用于替换、交换或代替某个东西的情境。
用法和例句:
用于物品的替换:
- 意思:用某种物品代替另一种物品。
- 例句: “You can use honey in place of sugar in this recipe.”(在这个食谱中你可以用蜂蜜代替糖。)
用于人的替换:
- 意思:用某个人代替另一个人。
- 例句: “She attended the meeting in place of her boss.”(她代替她的老板参加了会议。)
用于抽象事物的替换:
- 意思:某种概念或情况被另一种替代。
- 例句: “Laughter came in place of the tension that filled the room earlier.”(笑声取代了先前充满房间的紧张气氛。)
近义词:
- Instead of: “He drank tea instead of coffee.”(他喝了茶而不是咖啡。)
- As a substitute for: “She used a pencil as a substitute for a pen.”(她用铅笔代替钢笔。)
总结来说,“in place of” 用来表达一种代替的关系,无论是具体物品、人物,还是抽象概念。
In place of a base class name, other arbitrary expressions are also allowed.
还允许使用其他任意表达式来代替基类名称。
descend
“Descend” 主要用来表示从高处往低处移动,也可以表示继承、情况恶化或突然造访。常见搭配包括 “descend into”(陷入)、“descend from”(继承于)、“descend on/upon”(突然造访或袭击)。
the corresponding class attribute is searched, descending down the chain of base classes if necessary
搜索相应的类属性,如有必要,沿着基类链向下搜索
yield
此处表示 产生 ,生产的意思
the method reference is valid if this yields a function object.
如果生成函数对象,则方法引用有效
exhibit
表示展会 ,展现,
“Exhibit” 作为动词时,可以表示展示、展览或表现某种特质;作为名词时,指展览品、展品或法律证据。
Dynamic ordering is necessary because all cases of multiple inheritance exhibit one or more diamond relationships
动态排序是必要的,因为多重继承的所有情况都表现出一种或多种菱形关系
pervade
/pərˈveɪd/
词根词缀: per-完全,贯穿,通过 + -vad-走 + -e
表示“弥漫”、“渗透”或“遍布”。
“Pervade” 是一个动词,意思是 “弥漫”、“遍及”、“渗透到”。它通常用来描述某种气氛、气味、思想等广泛地存在或充满某个地方或群体。这个词带有一种"全面扩散"的含义。
以下是一些例句,展示了 “pervade” 的常见用法:
指气味或气氛的弥漫:
- A sense of calm pervaded the room.
(一种平静的感觉弥漫在房间里。)- The smell of fresh flowers pervaded the garden.
(新鲜花朵的香气弥漫了整个花园。)指思想、态度等的渗透:
- A feeling of optimism pervaded the community after the election results.
(选举结果出来后,乐观情绪遍及整个社区。)- His influence pervades every aspect of the company’s culture.
(他的影响渗透到了公司文化的每一个方面。)描述物质、能量等的扩散:
- The bright light pervaded the entire room.
(明亮的灯光充满了整个房间。)“Pervade” 多用来描述某种东西(如感觉、气味、思想等)充满或影响某个地方或群体,并且强调它的广泛存在。
The use of iterators pervades and unifies Python.
迭代器的使用遍及并统一了 Python。
resume
“Resume” 是一个多义词,既可以用作动词,也可以用作名词。下面是它的不同用法:
1. 动词(恢复,重新开始)
当 “resume” 作动词时,意思是 恢复某个中断的活动,或者 重新开始某事。
- 用法:
resume + 名词/动名词
例句:
- After a short break, the meeting resumed. (短暂休息后,会议重新开始了。)
- She resumed her studies after a year off. (休息一年后,她重新开始了学业。)
- The rain stopped, so we resumed our walk. (雨停了,所以我们继续散步。)
2. 名词(简历)
作为名词时,“resume” 指的是 简历,即一个人关于教育背景、工作经历等的简要书面描述,通常用于申请工作。
- 用法:指代文件本身或用于申请工作的简历。
例句:
- Please send your resume and cover letter to the HR department. (请将您的简历和求职信发送给人力资源部。)
- He updated his resume to include his recent work experience. (他更新了简历,加入了最近的工作经验。)
the generator resumes where it left off
生成器从上次停止的地方恢复
keep from
“Keep from” 是一个常见的动词短语,意思是 避免、防止 或 抑制自己做某事。它常用来表示阻止某个行为发生,或者努力不去做某事。
1. 防止某事发生(prevent something from happening)
表示阻止某事的发生或防止某人做某事。
- 用法:
keep + someone/something + from + 动名词/名词
例句:
- He tried to keep me from making a mistake.
(他试图阻止我犯错。)- The heavy rain kept us from going outside.
(大雨阻止了我们外出。)2. 抑制自己做某事(stop oneself from doing something)
表示克制或避免自己做某事,通常是一种情绪或冲动。
- 用法:
keep + oneself + from + 动名词
例句:
- She could barely keep herself from laughing.
(她几乎无法抑制住自己不笑。)- I had to keep from crying when I heard the bad news.
(听到这个坏消息时,我必须忍住不哭。)3. 阻止某人做某事(prevent someone from doing something)
- 用法:
keep + someone + from + 动名词
例句:
- The injury kept him from playing in the game.
(伤病让他无法参加比赛。)总结:Keep from 可以用来表示防止某事发生、阻止某人做某事,或抑制某种行为或情感。
This will keep os.open()
from shadowing the built-in open()
function which operates much differently.
这将使 os.open() 不会遮盖内置 open() 函数,该函数的操作方式有很大不同。