当前位置:网站首页>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用户进程管理 实验报告
- Emqtt distribution cluster and node bridge construction
- Fundamentals of digital circuit (V) arithmetic operation circuit
- The salary of testers is polarized. How to become an automated test with a monthly salary of 20K?
- UCORE lab1 system software startup process experimental report
- Expanded polystyrene (EPS) global and Chinese markets 2022-2028: technology, participants, trends, market size and share Research Report
- Functions: Finding Roots of equations
- Transplant hummingbird e203 core to Da Vinci pro35t [Jichuang xinlai risc-v Cup] (I)
- Stc-b learning board buzzer plays music
- Using flask_ Whooshalchemyplus Jieba realizes global search of flask
猜你喜欢
Statistics 8th Edition Jia Junping Chapter 2 after class exercises and answer summary
Wang Shuang's detailed notes on assembly language learning I: basic knowledge
基于485总线的评分系统双机实验报告
数字电路基础(五)算术运算电路
Report on the double computer experiment of scoring system based on 485 bus
Nest and merge new videos, and preset new video titles
Fundamentals of digital circuits (II) logic algebra
Soft exam information system project manager_ Project set project portfolio management --- Senior Information System Project Manager of soft exam 025
Summary of thread implementation
Sleep quality today 81 points
随机推荐
Global and Chinese markets of MPV ACC ECU 2022-2028: Research Report on technology, participants, trends, market size and share
pytest
UCORE lab7 synchronous mutual exclusion experiment report
Es full text index
Software testing interview summary - common interview questions
Statistics 8th Edition Jia Junping Chapter 2 after class exercises and answer summary
软件测试方法有哪些?带你看点不一样的东西
Keil5-MDK的格式化代码工具及添加快捷方式
ByteDance ten years of experience, old bird, took more than half a year to sort out the software test interview questions
Matplotlib绘图快速入门
Don't you even look at such a detailed and comprehensive written software test question?
Function: find the maximum common divisor and the minimum common multiple of two positive numbers
How to solve the poor sound quality of Vos?
Global and Chinese market of portable and handheld TVs 2022-2028: Research Report on technology, participants, trends, market size and share
ucore lab8 文件系统 实验报告
Fundamentals of digital circuits (II) logic algebra
Sorting odd and even subscripts respectively for leetcode simple problem
Global and Chinese markets of electronic grade hexafluorobutadiene (C4F6) 2022-2028: Research Report on technology, participants, trends, market size and share
[oiclass] maximum formula
软件测试需求分析之什么是“试纸测试”