Python - Closure

  >>> >>> def A(data): ... def A_a(): ... print(data) ... return A_a ... >>> new = A(12) >>> new <function A.<locals>.A_a at 0x000000BEC82B0730> >>> new() 12 >>> del A >>> A(12) Tr
相關文章
相關標籤/搜索