Skip to content

Commit

Permalink
Fix README.md
Browse files Browse the repository at this point in the history
Bump version to 2.2.0
  • Loading branch information
Rud356 committed Jul 24, 2021
1 parent bf85fb0 commit c39269a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ConfigFramework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from .base_config import BaseConfig # noqa: package exported variables
from .dump_caster import DumpCaster # noqa: package exported variables

__version__ = "2.1.1"
__version__ = "2.2.0"
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,23 @@ See examples with explanation [here](https://github.com/Rud356/ConfigFramework/b
```python3
from ConfigFramework import BaseConfig
from ConfigFramework.loaders import DictLoader
from ConfigFramework.variables import ConfigVar
from ConfigFramework.variables import ConfigVar, IntVar
from ConfigFramework.custom_types import VariableType

loader = DictLoader.load({"a": 1, "b": 2.22})


class Config(BaseConfig):
a: VariableType[int] = ConfigVar("a", loader)
b: VariableType[float] = ConfigVar("b", loader)
# Following method of type hinting is deprecated and will be deleted in 2.5.0
a: VariableType[int] = IntVar("a", loader)
# Since 2.2.0 it's recommended to use ConfigVar to type hint things
b: ConfigVar[float] = ConfigVar("b", loader)


conf = Config()
# You will get float functions suggestions from IDE if you use it like that!
conf.b.value.as_integer_ratio()

```

## Supported formats
Expand Down

0 comments on commit c39269a

Please sign in to comment.