是否有纯粹用python编写的内置python功能?
内置函数的功能定义,例如print
,input
等,因为它们已写在C中。在函数中,还是在Python中编写任何内置功能?
编辑:我专门谈论CPYTHON实现。
The function definitions for built-in functions such as print
, input
, etc., cannot be seen because they have been written in C. Is that the case for all built-in functions, or is there any built-in function that has been written in Python?
Edit: I am specifically talking about the CPython implementation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
几周前,我问自己同样的问题。这是我尝试的:
唯一具有Python源可用的内置属性是
__加载程序__
。当您查看它时,您会知道它并不是真正的内置。因此,您问题的最终答案是否定。在Cpython实施中,没有用纯Python编写的内置。
I asked myself the same question a few weeks ago. Here is what I tried :
The only builtins attribute with python source availaible is
__loader__
. When you look about it you understand that it is not really a builtin.So the final answer to your question is no. There is no builtin written in pure Python in the CPython implementation.