author:headsen chen date:2018-03-21 15:12:09 notice:created by headsen chen himself and not allowed to copy ,or you count law questions. 1,打印函数名和打印函数的执行过程的区别: =============> 总结:打印函数名print(a),结果是把该函数的内存地址打印出来了. 打印函数的执行:print(a( )…
我们虽然经常用到try...except 作为异常补货,但是其实很少去研究try源码和机制,也许点进去看过,也是看不出个所以然来 class Exception(BaseException): """ Common base class for all non-exit exceptions. """ def __init__(self, *args, **kwargs): # real signature unknown pass 继承了Bas…
python中的参数传递类似java,有着自己的内存回收机制,这和C++有着很大的差别. 1.函数的参数传递: >>> a = [, , ] >>> def fun(a): for i in a: print i a.append(4) >>> fun(a) >>> a [, , , ] 从上面的结果可以看出,python的函数传递是引用传递,因此,在函数体内修改对象内容会导致函数外面的对象内容改变. 这个对于一些内置类型,如int,…