Skip to content

Commit 44913e1

Browse files
authored
Update get_auto_imports() to also allow returning None (#2956)
Returning `None` is the documented way to permanently disable automatic imports. https://docs.djangoproject.com/en/5.2/howto/custom-shell/#customizing-shell-auto-imports There is also specific handling of `None` within Django's `shell` management command. https://github.com/django/django/blob/5.2.9/django/core/management/commands/shell.py#L170-L172
1 parent a579836 commit 44913e1

File tree

1 file changed

+1
-1
lines changed
  • django-stubs/core/management/commands

1 file changed

+1
-1
lines changed

django-stubs/core/management/commands/shell.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ class Command(BaseCommand):
99
def ipython(self, options: Any) -> None: ...
1010
def bpython(self, options: Any) -> None: ...
1111
def python(self, options: Any) -> None: ...
12-
def get_auto_imports(self) -> list[str]: ...
12+
def get_auto_imports(self) -> list[str] | None: ...
1313
def get_namespace(self, **options: Any) -> dict[str, Any]: ...

0 commit comments

Comments
 (0)