diff options
author | Michael Foord <michael@voidspace.org.uk> | 2011-10-06 23:30:52 +0100 |
---|---|---|
committer | Michael Foord <michael@voidspace.org.uk> | 2011-10-06 23:30:52 +0100 |
commit | 0a84cc46ef310c005978b451bf29048b23d897a1 (patch) | |
tree | 7b0e7bb534d2de627d2d25f34f285884af245f5f /mock.py | |
parent | 5b69a4fd657e3cffc0bc4779969f8e2a049916b9 (diff) | |
download | mock-0a84cc46ef310c005978b451bf29048b23d897a1.tar.gz |
Rename Sentinel and SentinelObject classes to make it clear they are private
Diffstat (limited to 'mock.py')
-rw-r--r-- | mock.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -375,7 +375,7 @@ def _is_magic(name): return '__%s__' % name[2:-2] == name -class SentinelObject(object): +class _SentinelObject(object): "A unique, named, sentinel object." def __init__(self, name): self.name = name @@ -384,7 +384,7 @@ class SentinelObject(object): return '<SentinelObject "%s">' % self.name -class Sentinel(object): +class _Sentinel(object): """Access attributes to return a named object, usable as a sentinel.""" def __init__(self): self._sentinels = {} @@ -393,10 +393,10 @@ class Sentinel(object): if name == '__bases__': # Without this help(mock) raises an exception raise AttributeError - return self._sentinels.setdefault(name, SentinelObject(name)) + return self._sentinels.setdefault(name, _SentinelObject(name)) -sentinel = Sentinel() +sentinel = _Sentinel() DEFAULT = sentinel.DEFAULT |