mirror of
https://github.com/kennethreitz/clint.git
synced 2026-06-05 23:00:18 +00:00
BORG
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
class Borg(object):
|
||||
"""All instances of Borg have the same value."""
|
||||
_shared_state = {}
|
||||
def __new__(cls, *a, **k):
|
||||
obj = object.__new__(cls, *a, **k)
|
||||
obj.__dict__ = cls._shared_state
|
||||
return obj
|
||||
Reference in New Issue
Block a user