看板 Python 關於我們 聯絡資訊
class-based https://repl.it/JZn4/12 但還是很醜........ 如果沒猜錯的話,外層應該會在 init() < 0 的時候再 release_process3() 。 這樣的行為跟 switch-case 的 fall-through 其實沒啥關係... (btw, golang 的 switch 是 fall-through by default) 比較有關的大概是 RAII (https://goo.gl/jZHYyw ),在 Python 基本上就是用 context manager 來實作。 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 203.77.72.241 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1508433543.A.15B.html