Skip to content

Commit f53a890

Browse files
committed
Make Config inherit from collections.abc.Mapping
1 parent b737cbe commit f53a890

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

pyconfigparser.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import yaml
66
import os
77
import re
8+
from collections.abc import Mapping
89

910
__all__ = [
1011
"ConfigError",
@@ -106,7 +107,7 @@ def _extract_env_variable_key(variable):
106107
}
107108

108109

109-
class Config:
110+
class Config(Mapping):
110111

111112
def __getitem__(self, item):
112113
return self.__dict__[item]
@@ -117,12 +118,6 @@ def __iter__(self):
117118
def __len__(self):
118119
return len(self.__dict__)
119120

120-
def keys(self):
121-
return self.__dict__.keys()
122-
123-
def values(self):
124-
return self.__dict__.values()
125-
126121

127122
class ConfigParser:
128123
def __init__(self):

0 commit comments

Comments
 (0)