is_regex_type raises AttributeError when evaluating typing types
Closed this issue · 2 comments
stephen-bunn commented
Current Behavior
Building a schema for a config which mixes both file_config.Regex
types and typing.List
types can sometimes cause AttributeError on type_.__name__
checks for is_regex_type
.
Possible Solution
This is an edge case which can be fixed by just having a statement which enforces that all types sent to is_regex_type
cannot be typing types.
Steps to Reproduce (for bugs)
- Create a config which uses
var(List[str])
andvar(file_config.Regex)
- Edge case only occurs when Regex is evaluated before List which casues lru_cache to try and use
is_regex_type
again
Your Environment
- File Config Version: 0.3.2
- Python Version: 3.7
- Operating System and Version: Ubuntu 18.04
❤️ Thank you!
stephen-bunn commented
The fix provided in d3590b9 is not valid as typing.Regex
is a generated typing type.
stephen-bunn commented
Most likely fixed in aada2af