Skip to content

Commit 1a09b92

Browse files
committed
-
1 parent 848be93 commit 1a09b92

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

source_py3/python_toolbox/caching/cached_type.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ class CachedType(type):
2020
2121
For example, if you have a class like this:
2222
23-
class Grokker(object):
24-
25-
__metaclass__ = caching.CachedType
26-
23+
class Grokker(object, metaclass=caching.CachedType):
2724
def __init__(self, a, b=2):
2825
self.a = a
2926
self.b = b

source_py3/python_toolbox/context_management/context_manager.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class ContextManager(DecoratingContextManager, metaclass=ContextManagerType):
3737
`python_toolbox.context_manager`.
3838
'''
3939

40-
4140
@abc.abstractmethod
4241
def __enter__(self):
4342
'''Prepare for suite execution.'''

source_py3/python_toolbox/context_management/context_manager_type.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def MyContextManager():
3636
`python_toolbox.context_manager`.
3737
'''
3838

39-
4039
def __new__(mcls, name, bases, namespace):
4140
'''
4241
Create either `ContextManager` itself or a subclass of it.

source_py3/python_toolbox/context_management/context_manager_type_type.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010

1111

1212
class ContextManagerTypeType(type):
13-
'''Metaclass for `ContextManagerType`. Shouldn't be used directly.'''
13+
'''
14+
Metaclass for `ContextManagerType`. Shouldn't be used directly.
15+
16+
Did I just create a metaclass for a metaclass. OH YES I DID. It's like a
17+
double rainbow, except I'm the only one who can see it.
18+
'''
1419

1520
def __call__(cls, *args):
1621
'''

source_py3/test_python_toolbox/test_persistent/test_cross_process_persistent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
from python_toolbox.persistent import CrossProcessPersistent
2222

2323

24-
class AbstractCrossProcessPersistent(CrossProcessPersistent, metaclass=abc.ABCMeta):
24+
class AbstractCrossProcessPersistent(CrossProcessPersistent,
25+
metaclass=abc.ABCMeta):
2526
'''
2627
An abstract cross-process persistent.
2728

0 commit comments

Comments
 (0)