I'm reading through some of Werkzeug's source and stumbled upon this nugget in the werkzeug.wrappers module.
def _run_wsgi_app(*args):
"""This function replaces itself to ensure that the test module is not
imported unless required. DO NOT USE!
"""
global _run_wsgi_app
from werkzeug.test import run_wsgi_app as _run_wsgi_app
return _run_wsgi_app(*args)
What are the fine prints of doing something like this? What's the difference between this definition and another without the global _run_wsgi_app
statement?