【发布时间】:2019-04-20 11:38:16
【问题描述】:
我真的很想知道 Visual Studio Code 中是否有一些扩展或其他方式可以帮助识别和删除任何未使用的导入。
我有大量这样的导入,并且接近 40 行。我知道其中一些没有使用,问题是安全地移除它们。
from django.core.mail import EmailMultiAlternatives, send_mail
from django.template.loader import render_to_string
from django.utils.html import strip_tags
from rest_framework import routers, serializers, viewsets, status
from rest_framework.views import APIView
from rest_framework.response import Response
from django.contrib.auth.models import User
【问题讨论】:
-
为 pylint 启用未使用的导入
-
@HSK 详细说明如何在 vs 代码中为 pylint 启用未使用导入