[oeasy]python057_如何删除print函数_dunder_builtins_

B站影视 2025-01-06 09:06 2

摘要:An awkward thing about programming in Python : there are lots of double underscores. [snip] My problem with the double underscore

位置作用放后面避免名字冲突为什么 很多本地变量两边 都有 两个下划线__name____doc____builtins__有什么说法吗??双下划线是 系统建立的有特殊的含义去游乐场问问python本人直接help主题的名字help("IDENTIFIERS")查找 标识符的帮助两边双下划线代表 系统定义的标识符比如__builtins__突然发现print函数不在本地可以删除print函数吗?del print无法删除!如果我就想删除呢?printprint是built-in function内建模块 的 函数内建模块 是不是 就是__builtins__ ???type(__builtins__)builtins 是 内建模块print会不会在这个模块里?新艺术 是怎么清屏的呢?使用 系统命令clearos.system("clear")os 是模块名后面的点(.) 表示里面的system 是函数名__builtins____builtins__.print__builtins__.print("Hello world!")确实找到了!print 就是__builtins__ 模块里的 函数能删除吗?带着模块名 一起删删完了就真的 连 print 都找不到了!!!__builtins__这个系统模块太重要了!!!怎么读呢?

Dunder (Double UNDERscore) Alias

Mark Jackson was the first to suggest dunder as a speech shorthand for double underscores (__) in a reply to a query from Pat Notz. Ned Batchelder later stressed the need for a way of pronouncing __:

An awkward thing about programming in Python : there are lots of double underscores. [snip] My problem with the double underscore is that it's hard to say. How do you pronounce init__? "underscore underscore init underscore underscore"? "under under init under under"? Just plain "init" seems to leave out something important. I have a solution: double underscore should be pronounced "dunder". So __init is "dunder init dunder", or just "dunder init".

最初 是为了 说起来省事连读 再加 吞字 得到的dunder 意味着 这个变量是 系统定义 的!能删吗?__builtins__ 迅速重生快得就像韭菜能把这个__builtins__覆盖了吗?能把内建模块(builtins)覆盖掉吗??我们下次再说!蓝桥->https://www.lanqiao.cn/courses/3584github->https://github.com/overmind1980/oeasy-python-tutorialgitee->https://gitee.com/overmind1980/oeasypython

来源:oeasy一点号

相关推荐