当前位置:网站首页>Should wildcard import be avoided- Should wildcard import be avoided?
Should wildcard import be avoided- Should wildcard import be avoided?
2022-07-06 15:08:00 【fyin1314】
problem :
I'm using PyQt and am running into this issue. I am using PyQt And encountered this problem .If my import statements are: If my import statement is :
from PyQt4.QtCore import *from PyQt4.QtGui import *
then pylint gives hundreds of "Unused import" warnings. then pylint Hundreds of “ Unused imports ” Warning .I'm hesitant to just turn them off, because there might be other unused imports that are actually useful to see. I'm hesitant to close them , Because there may be other unused imports that are actually useful .Another option would be to do this: Another option is to do so :
from PyQt4.QtCore import Qt, QPointF, QRectFfrom PyQt4.QtGui import QGraphicsItem, QGraphicsScene, ...
and I end up having 9 classes on the QtGui line. I ended up in QtGui On line 9 A course .There's a third option, which is: There is a third option , namely :
from PyQt4 import QtCore, QtGui
and then prefix all the classes with QtCore or QtGui whenever I use them. Then whenever I use them , use QtCore or QtGui Prefix all classes .
At this point I'm agnostic as to which one I end up doing in my project, although the last one seems the most painful from my perspective. At this point , I don't know which one I finally did in my project , Although from my point of view , The last one seems to be the most painful .What are the common practices here? What are the common practices here ?Are there technical reason to use one style over the other? Is there a technical reason to use one style instead of another ?
Solution :
Reference resources : https://stackoom.com/en/question/FAST边栏推荐
- ucore lab5用户进程管理 实验报告
- Statistics 8th Edition Jia Junping Chapter 1 after class exercises and answers summary
- [pointer] solve the last person left
- How to use Moment. JS to check whether the current time is between 2 times
- Which version of MySQL does php7 work best with?
- Global and Chinese market of goat milk powder 2022-2028: Research Report on technology, participants, trends, market size and share
- Sorting odd and even subscripts respectively for leetcode simple problem
- Pedestrian re identification (Reid) - data set description market-1501
- Expanded polystyrene (EPS) global and Chinese markets 2022-2028: technology, participants, trends, market size and share Research Report
- Zhejiang University Edition "C language programming experiment and exercise guide (3rd Edition)" topic set
猜你喜欢
Fundamentals of digital circuits (II) logic algebra
Report on the double computer experiment of scoring system based on 485 bus
Statistics 8th Edition Jia Junping Chapter 2 after class exercises and answer summary
How to transform functional testing into automated testing?
"If life is just like the first sight" -- risc-v
Nest and merge new videos, and preset new video titles
Matplotlib绘图快速入门
What is the transaction of MySQL? What is dirty reading and what is unreal reading? Not repeatable?
Cc36 different subsequences
Summary of thread implementation
随机推荐
Wang Shuang's detailed notes on assembly language learning I: basic knowledge
Oracle foundation and system table
Global and Chinese markets of cobalt 2022-2028: Research Report on technology, participants, trends, market size and share
软件测试方法有哪些?带你看点不一样的东西
Using flask_ Whooshalchemyplus Jieba realizes global search of flask
Global and Chinese markets of electronic grade hexafluorobutadiene (C4F6) 2022-2028: Research Report on technology, participants, trends, market size and share
[pointer] find the largest string
ucore lab6 调度器 实验报告
ucore lab1 系统软件启动过程 实验报告
{1,2,3,2,5} duplicate checking problem
Transplant hummingbird e203 core to Da Vinci pro35t [Jichuang xinlai risc-v Cup] (I)
pytest
Statistics 8th Edition Jia Junping Chapter 2 after class exercises and answer summary
CSAPP家庭作業答案7 8 9章
Rearrange spaces between words in leetcode simple questions
Four methods of exchanging the values of a and B
接口测试面试题及参考答案,轻松拿捏面试官
Install and run tensorflow object detection API video object recognition system of Google open source
Global and Chinese market of portable and handheld TVs 2022-2028: Research Report on technology, participants, trends, market size and share
如何成为一个好的软件测试员?绝大多数人都不知道的秘密