do not emit error, if attribute does not exist

This commit is contained in:
Maxim Kurnikov
2018-12-06 17:45:27 +03:00
parent cf6119bf9b
commit 447651c770
5 changed files with 10 additions and 4 deletions

View File

@@ -40,8 +40,6 @@ reveal_type(settings.REGISTRY) # E: Revealed type is 'Union[main.Class, None]'
reveal_type(settings.LIST) # E: Revealed type is 'Any'
reveal_type(settings.BASE_LIST) # E: Revealed type is 'Any'
[out]
main:5: error: "LazySettings" has no attribute "LIST"
main:6: error: "LazySettings" has no attribute "BASE_LIST"
mysettings:4: error: Need type annotation for 'LIST'
base:6: error: Need type annotation for 'BASE_LIST'
@@ -80,3 +78,10 @@ MYSETTING = 1122
REGISTRY: Optional['Class'] = None
LIST: List[str] = ['1', '2']
[CASE allow_calls_to_nonexistent_members_for_now]
from django.conf import settings
reveal_type(settings.NOT_EXISTING) # E: Revealed type is 'Any'
[env DJANGO_SETTINGS_MODULE=mysettings]
[file mysettings.py]
[out]