Skip to content

Instantly share code, notes, and snippets.

View slothyrulez's full-sized avatar

Alex slothyrulez

View GitHub Profile
@slothyrulez
slothyrulez / autodiscover.py
Created October 31, 2015 19:40 — forked from o3bvv/autodiscover.py
Django module autodiscover
from imp import find_module
from importlib import import_module
import sys
def autodiscover_module(module_name, installed_apps=None):
if installed_apps is None:
from django.conf import settings
installed_apps = settings.INSTALLED_APPS
@slothyrulez
slothyrulez / benchmark_attribute_access.py
Created May 10, 2024 13:02 — forked from wolph/benchmark_attribute_access.py
Benchmark namedtuple vs dataclass vs dict
import sys
import enum
import math
import random
import timeit
import typing
import dataclasses
import collections