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

RepositoryEmpty isn't actually empty #175

Open
kanzure opened this issue Dec 4, 2024 · 0 comments
Open

RepositoryEmpty isn't actually empty #175

kanzure opened this issue Dec 4, 2024 · 0 comments

Comments

@kanzure
Copy link

kanzure commented Dec 4, 2024

This isn't an "issue" so much as a note I'd like to leave for others. Maybe a code change is warranted or a README update?

RepositoryEmpty.__contains__ is correctly implemented but __getitem__ returns None, which does not seem like an appropriate default value for app environment variables. Collections like a dictionary's __getitem__ will raise a KeyError instead.

Another alternative for an actually empty repository is to pass an empty dictionary instead of using RepositoryEmpty.

I don't know why RepositoryEmpty exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant