Skip to content

Implement __getitem__ and __setitem__ methods #42

@ziggycross

Description

@ziggycross

It seems the current approach for managing config is with .get and .set methods.
I believe it would make sense to also implement __getitem__ and __setitem__ dunder methods in addition to this.

For example, the code example

config.set('number', 42)
config.get('number')

could also be written as

config["number"] = 42
config["number"]

Looking at the source, this should be a relatively small update to implement. If you think this would be acceptable, I am happy to add it myself and submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions