Open Vykstorm opened 5 years ago
It would be usefull for mypy to infer the types of the values returned by the methods as_bool(), as_int(), ... in the Section class
mypy (not python) will raise an error when executing the next code:
from configobj import ConfigObj
def foo(a : str) -> None:
pass
config = ConfigObj('example.cnf')
foo(config.as_bool('myval'))
error: Argument 1 to "foo" has incompatible type "bool"; expected "str"
I started something to do this: https://github.com/JEFuller/dataclasses-configobj
I think this is a good idea and typing support in my IDE is generally an important thing for me as a developer.
I don't think that I'm capable of doing anything with this for 5.1.0, but I hope someone is able to take something like this on
Hello. I just wanted to suggest adding a 'stub' for this library for static typing using the library mypy (no need to change code, the stub can go in a separate file). I have my own version here (incomplete)
For example, here is part of the code related to ConfigObj constructor