Skip to content

Commit bb34530

Browse files
committed
Metaclass is declared in the class declaration
1 parent 0680f71 commit bb34530

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

dice_notation/dice.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
xrange = range
2525

2626

27-
class Rollable(object):
27+
class Rollable(object, metaclass=ABCMeta):
2828
"""
2929
Interface for rollable classes.
3030
@@ -37,7 +37,6 @@ class Rollable(object):
3737
3838
As such, the value generated by rolling may be anything.
3939
"""
40-
__metaclass__ = ABCMeta
4140

4241
def __init__(self):
4342
pass

dice_notation/parser/common.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@
1717
__license__ = 'MIT'
1818

1919

20-
class Parser(object):
20+
class Parser(object, metaclass=ABCMeta):
2121
"""
2222
Interface for implementing parsers.
2323
2424
It just contains a single method, 'parse', which will receive a value
2525
and take care of parsing it into another.
2626
"""
2727

28-
__metaclass__ = ABCMeta
29-
3028
def __init__(self):
3129
pass
3230

0 commit comments

Comments
 (0)