Skip to content

Instantly share code, notes, and snippets.

View noamgot's full-sized avatar

noamgot

View GitHub Profile
@wowkin2
wowkin2 / SingletonMongoClient.py
Created May 14, 2016 17:20
Python Singleton with parameters (so the same parameters get you the same object) with support to default arguments and passing arguments as kwargs (but no support for pure kwargs).
"""
Python Singleton with parameters (so the same parameters get you the same object)
with support to default arguments and passing arguments as kwargs (but no support for pure kwargs).
And implementation for MongoClient class from pymongo package.
"""
from pymongo import MongoClient
import inspect