Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make Config inherit from collections.abc.Mapping #28

Merged
merged 4 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand Down
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