I'm coming from Java world and I'm quite confused with variable scopes in Python:
from flask import Flask, request
@app.route('/', methods=['POST'])
def handle():
form = request.form
In HTTP servers I worked with I was used to convention that variables like request
are either passed as method parameters or retrieved from ThreadLocal
. Why Flask/Python uses global variables in this case? Is it thread-safe?