Skip to content

Commit 4649dc2

Browse files
committed
更新参数
1 parent 2915b5d commit 4649dc2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Learning Python/4、函数和生成器/3. 参数.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"- **参数的传递是通过自动将对象赋值给本地变量名来实现的。**因为引用是以指针的形式实现的,所有的参数实际上都是通过指针进行传递的。作为参数,被传递的对象从来不自动拷贝。\n",
1010
"- **在函数内部的参数名的赋值不会影响调用者。**在函数运行时,在函数头部的参数名是一个新的、本地的变量名,这个变量名是在函数的本地作用域内的。\n",
1111
"- **改变函数的可变对象参数的值也许会对调用者有影响。**因为参数是简单地赋值给传入的对象,函数能够就地改变传入的可变对象,其结果会影响调用者。\n",
12+
"- **不可变参数“通过值”进行传递。**\n",
13+
"- **可变对象通过“指针”进行传递。**\n",
1214
"\n",
1315
"## 1.1 参数和共享引用 "
1416
]
@@ -1120,7 +1122,7 @@
11201122
"name": "python",
11211123
"nbconvert_exporter": "python",
11221124
"pygments_lexer": "ipython3",
1123-
"version": "3.6.6"
1125+
"version": "3.6.8"
11241126
}
11251127
},
11261128
"nbformat": 4,

0 commit comments

Comments
 (0)