当前位置:网站首页>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边栏推荐
- Four methods of exchanging the values of a and B
- Build your own application based on Google's open source tensorflow object detection API video object recognition system (I)
- 如何成为一个好的软件测试员?绝大多数人都不知道的秘密
- Leetcode simple question: check whether the numbers in the sentence are increasing
- Investment should be calm
- Global and Chinese markets of PIM analyzers 2022-2028: Research Report on technology, participants, trends, market size and share
- [oiclass] maximum formula
- Build your own application based on Google's open source tensorflow object detection API video object recognition system (II)
- In Oracle, start with connect by prior recursive query is used to query multi-level subordinate employees.
- [HCIA continuous update] advanced features of routing
猜你喜欢
数字电路基础(四) 数据分配器、数据选择器和数值比较器
Query method of database multi table link
Database monitoring SQL execution
Dlib detects blink times based on video stream
STC-B学习板蜂鸣器播放音乐
The number of reversing twice in leetcode simple question
DVWA exercise 05 file upload file upload
软件测试需求分析之什么是“试纸测试”
Nest and merge new videos, and preset new video titles
Cadence physical library lef file syntax learning [continuous update]
随机推荐
如何成为一个好的软件测试员?绝大多数人都不知道的秘密
指針:最大值、最小值和平均值
Transplant hummingbird e203 core to Da Vinci pro35t [Jichuang xinlai risc-v Cup] (I)
Install and run tensorflow object detection API video object recognition system of Google open source
Global and Chinese market of barrier thin film flexible electronics 2022-2028: Research Report on technology, participants, trends, market size and share
The common methods of servlet context, session and request objects and the scope of storing data in servlet.
Investment operation steps
Wang Shuang's detailed notes on assembly language learning I: basic knowledge
Oracle foundation and system table
DVWA exercise 05 file upload file upload
Global and Chinese market of pinhole glossmeter 2022-2028: Research Report on technology, participants, trends, market size and share
软件测试工作太忙没时间学习怎么办?
Software testing interview summary - common interview questions
C language do while loop classic Level 2 questions
C language learning summary (I) (under update)
Nest and merge new videos, and preset new video titles
My first blog
Fundamentals of digital circuit (V) arithmetic operation circuit
Rearrange spaces between words in leetcode simple questions
UCORE lab7 synchronous mutual exclusion experiment report