Skip to content

Instantly share code, notes, and snippets.

import ast
from typing import override
filename = "ex1.py"
content = open(filename).read()
tree = ast.parse(content)
MODULE_SCOPE = "module"
@hagai26
hagai26 / gist:0f1c27e24788242dc3b9
Created December 4, 2014 12:29
flask-cache decorator with caching lock (no two clients inside same view)
# -*- coding: utf-8 -*-
"""
flask.ext.cache before (assume using redis)
~~~~~~~~~~~~~~
Adds support for caching before work
"""
import functools
import logging