057如何删除print函数_dunder_builtins_系统内建模块9 播放 · 0 赞同视频
[词根溯源]如何删除print函数_dunder_builtins_系统内建模块
回忆上次内容
-
为什么 很多本地变量
-
两边 都有 两个下划线
-
__name__
-
__doc__
-
__builtins__
-
两边双下划线
-
代表 系统定义的标识符
-
比如__builtins__
-
print是
-
built-in function
-
内建模块 的 函数
-
内建模块 是不是 就是
-
__builtins__ ???????
-
builtins 是 内建模块
-
print会不会在这个模块里?
-
新艺术 是怎么清屏的呢?
-
使用 系统命令
-
clear
-
os 是模块名
-
后面的点(.) 表示里面的
-
system 是函数名
照猫画虎
__builtins__ __builtins__.print __builtins__.print("Hello world!")
-
确实找到了!
-
print 就是
-
__builtins__ 模块里的 函数
删除
del __builtins__.print print
-
删完了
-
就真的 连 print 都找不到了!!!????
-
__builtins__
-
这个系统模块
-
太重要了!!!
-
怎么读呢?
-
两个下划线
-
Double UNDERscore
-
省略读法 dunder
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".
-
{BANNED}最佳初 是为了 说起来省事
-
连读 再加 吞字 得到的
-
而dunder
-
只有6个字符
-
发音是2声
-
简单多了
-
dunder 意味着 这个变量
-
是 系统定义 的!
-
能删吗?????
删除
del __builtins__ __builtins__
-
能把内建模块(builtins)
-
覆盖掉吗??????
-
我们下次再说!????
-
蓝桥->
-
github->
-
gitee->