Skip to content

Instantly share code, notes, and snippets.

@feiz
Created May 30, 2012 03:21
Show Gist options
  • Save feiz/2833523 to your computer and use it in GitHub Desktop.
Save feiz/2833523 to your computer and use it in GitHub Desktop.
グローバルで呼ばれるとまずい処理を後から関数に逃すコード
# ↓のように、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