python-3.x - 变量名的地址是什么?
问题描述
>>> x = "hello world"
>>> x
'hello world'
>>> id(x)
140461077304368
我们得到140461077304368
包含的地址hello world
。
>>> dir()
['__annotations__', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'x']
变量名称x
在命名空间中,x
地址是什么?还有一个容器包含x
,容器的地址是什么?
dir()
会占用内存空间,x
定位在空间中,该空间的地址是什么?诸如__spec__
then 之类的项目的地址是什么?
解决方案
推荐阅读
- html - CSS Grid:自动收缩空行?
- javascript - jQuery隐藏功能不适用于iframe
- php - 变量 PHP 文件读取
- flutter - Map 真的是 Flutter 中的一种类型吗?未完成的 Map 声明会破坏其他 Map 声明
- r - 切片向量显示错误范围
- android - Android约束布局textview包装上下文并在没有更多空间时显示椭圆
- python - 设置位数(x 或 y)+ 设置位数(x 和 y)= m。有没有办法解决这个方程,找到 x 和 y 之间的关系?
- drake - Drake 中“通过接触”轨迹优化的工作流程
- android - Android - 如何将依赖关系树导出到文件?
- emacs - Emacs 从缩进中排除关键字(Verilog)