I've never used Flask before and come from mostly PHP/JavaScript.
One of the first things that struck me reading the tutorial was the use of "g" which seems to stand for "global" and is used to access things like the DB via "g.db".
This seems similar to using $GLOBALS['db'] in PHP which would be a code smell and I think it's impossible as of PHP 8.1.
If I saw this in a PHP Framework I would assume it was made by an amateur. Can anyone explain if this is common practice in Python and perhaps why it's different and not a worry?