mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-18 18:05:58 +08:00
[WIP/RFC] Revisit patching of mypy builtins (reveal_{type,locals}) (#615)
* Revisit patching of mypy builtins (reveal_{type,locals})
Fixes https://github.com/typeddjango/django-stubs/issues/609
Reverts ee58b18f15
* Create test_patching.yml
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import builtins
|
||||
from typing import Any, Generic, List, Optional, Tuple, Type, TypeVar
|
||||
|
||||
from django import VERSION as VERSION
|
||||
@@ -62,9 +61,5 @@ def monkeypatch() -> None:
|
||||
for el in suited_for_this_version:
|
||||
el.cls.__class_getitem__ = classmethod(lambda cls, *args, **kwargs: cls)
|
||||
|
||||
# Define mypy builtins, to not cause NameError during setting up Django.
|
||||
builtins.reveal_type = lambda _: None
|
||||
builtins.reveal_locals = lambda: None
|
||||
|
||||
|
||||
__all__ = ["monkeypatch"]
|
||||
|
||||
Reference in New Issue
Block a user