mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-06 20:24:31 +08:00
do not emit error, if attribute does not exist
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user