开发者

How do I suppress "unused in wild import" warning in pydev?

How do I suppress "unused in wild import" warning in pyde开发者_如何学Gov?


Suppressing warning message for import / wild import

from django.db import connection #@UnusedImport
from django.db import * #@UnusedWildImport


Solution: Just "fakely" use something from that import:

from django.db import connection
_ = connection

For more details:

Similarly for wildcard:

from django.db import *
_ = connection # or anything in the django.db package

Personally I often use

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tensorflow as tf
_ = (plt,np,pd,tf)

P.S. The other answer does not work for me in PyCharm/Intellij Idea...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜