Created
May 30, 2012 03:21
-
-
Save feiz/2833523 to your computer and use it in GitHub Desktop.
グローバルで呼ばれるとまずい処理を後から関数に逃すコード
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ↓のように、yabai_funcをモジュールグローバルで呼んでる状態を直す | |
#yabai_obj = yabai_func() | |
def yabai_obj(): | |
global yabai_obj | |
obj = yabai_func() | |
yabai_obj = lambda: obj | |
return obj |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment