Skip to content

Commit

Permalink
Merge pull request #26 from danipozo/make-config-class-a-mapping
Browse files Browse the repository at this point in the history
Make config class a mapping
  • Loading branch information
BrunoSilvaAndrade authored Nov 27, 2023
2 parents 1c83c7e + f53a890 commit 0b7c0d2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pyconfigparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import yaml
import os
import re
from collections.abc import Mapping

__all__ = [
"ConfigError",
Expand Down Expand Up @@ -106,7 +107,7 @@ def _extract_env_variable_key(variable):
}


class Config:
class Config(Mapping):

def __getitem__(self, item):
return self.__dict__[item]
Expand All @@ -117,12 +118,6 @@ def __iter__(self):
def __len__(self):
return len(self.__dict__)

def keys(self):
return self.__dict__.keys()

def values(self):
return self.__dict__.values()


class ConfigParser:
def __init__(self):
Expand Down

0 comments on commit 0b7c0d2

Please sign in to comment.