Skip to content

Commit 1aac5b3

Browse files
committed
Use abc.ABCMeta as metaclass base for component as MutableMapping.
1 parent b29fa0a commit 1aac5b3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dash/development/base_component.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
import os
44
import inspect
55
import keyword
6+
import abc
67
import six
78

89

9-
class ComponentRegistry(type):
10+
class ComponentRegistry(abc.ABCMeta):
1011
"""Just importing a component lib will make it be loaded on the index"""
1112

1213
component_registry = set()
1314

1415
def __new__(mcs, name, bases, attributes):
15-
component = type.__new__(mcs, name, bases, attributes)
16+
component = abc.ABCMeta.__new__(mcs, name, bases, attributes)
1617
if name == 'Component':
1718
# Don't do the base component
1819
return component
@@ -72,7 +73,7 @@ def wrapper(*args, **kwargs):
7273

7374

7475
@six.add_metaclass(ComponentRegistry)
75-
class Component:
76+
class Component(collections.MutableMapping):
7677
class _UNDEFINED(object):
7778
def __repr__(self):
7879
return 'undefined'

0 commit comments

Comments
 (0)