You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running mypy example.py throws the following errors:
problem.py:7: error: Attributes without a default cannot follow attributes with one
problem.py:8: error: Attributes without a default cannot follow attributes with one
Found 2 errors in 1 file (checked 1 source file)
One can go around this problem by adding Union[None, <type>] to every attribute but this is not ideal since one might want to have attributes that throw error if no value is provided.
Environment
Ubuntu 20.04.1 LTS x86_64
mypy==0.782
python==3.8.5
Thanks for the great library by the way!
The text was updated successfully, but these errors were encountered:
Problem
yaml-data-class-config
doesn't currently support attributes without default values.Cause
The attribute
FILE_PATH
in config.py that does not have a default value causes the error.Possible solution
Remove the
FILE_PATH
attribute or add it after theconfig.yml
is loaded so that it doesn't cause problems with mypy.Example
config.yml
:example.py
:Running
mypy example.py
throws the following errors:One can go around this problem by adding
Union[None, <type>]
to every attribute but this is not ideal since one might want to have attributes that throw error if no value is provided.Environment
Thanks for the great library by the way!
The text was updated successfully, but these errors were encountered: