<div dir="auto"><div dir="auto">I generally avoid wildcard imports. Two additional reasons not to use them:</div><div dir="auto"><br></div>- When you use the wildcard form it is harder for other people (and for yourself in the future) to know just what it is that you are actually importing. As such, debugging eventual errors takes more time.<div dir="auto"><br></div><div dir="auto">- wildcard imports also increase the chance of having name clashes and of hiding functions with identical names.</div></div><div class="gmail_extra"><br><div class="gmail_quote">Em 10/05/2017 20:38, "Raymond Nijssen" <<a href="mailto:r.nijssen@terglobo.nl">r.nijssen@terglobo.nl</a>> escreveu:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Calvin,<br>
<br>
Here are some thoughts on python imports:<br>
<br>
<a href="https://www.python.org/dev/peps/pep-0008/#imports" rel="noreferrer" target="_blank">https://www.python.org/dev/pep<wbr>s/pep-0008/#imports</a><br>
<br>
The last paragraph is about using wildcards.<br>
<br>
Raymond<br>
<br>
On 10-05-17 20:03, C Hamilton wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am wondering how important it is to import the modules separately.<br>
Such as:<br>
<br>
from qgis.core import QGis, QgsCoordinateTransform, QgsRectangle,<br>
QgsPoint, QgsGeometry<br>
<br>
Does it really make a difference? I am finding that you have to make<br>
sure every part of your code is exercised so that nothing was missed. By<br>
doing the above there is more of a chance to have a bug. Perhaps for<br>
PyQt4.QtGui it makes sense, but there is less chance to have a python<br>
error if you keep.<br>
<br>
from qgis.core import *<br>
from PyQt4.QtGui import *<br>
from qgis.gui import *<br>
<br>
Thoughts?<br>
<br>
Thanks,<br>
<br>
Calvin<br>
<br>
<br>
<br>
On Wed, May 10, 2017 at 12:00 PM, Luigi Pirelli <<a href="mailto:luipir@gmail.com" target="_blank">luipir@gmail.com</a><br>
<mailto:<a href="mailto:luipir@gmail.com" target="_blank">luipir@gmail.com</a>>> wrote:<br>
<br>
    this is a slide about plugin porting I'll be presenting to the next<br>
    spanish foss4g:<br>
    <a href="http://slides.com/luigipirelli/desdarrolloplugindeqgis-xi-girona#/17" rel="noreferrer" target="_blank">http://slides.com/luigipirelli<wbr>/desdarrolloplugindeqgis-xi-gi<wbr>rona#/17</a><br>
    <<a href="http://slides.com/luigipirelli/desdarrolloplugindeqgis-xi-girona#/17" rel="noreferrer" target="_blank">http://slides.com/luigipirell<wbr>i/desdarrolloplugindeqgis-xi-g<wbr>irona#/17</a>><br>
    sorry it's in spanish<br>
<br>
    about<br>
<br>
    from PyQt4 import QtGui<br>
<br>
    or<br>
<br>
    from PyQt4.QtGui import QDialog<br>
<br>
    I would prefer the second so to avoid to postpone lib version errors<br>
    at pyc time and not at runtime.<br>
    it make it simpler to mock or alias a class globally if you need<br>
<br>
    regards<br>
    Luigi Pirelli<br>
<br>
    ******************************<wbr>******************************<wbr>******************************<wbr>********<br>
    * Boundless QGIS Support/Development: lpirelli AT boundlessgeo DOT com<br>
    * LinkedIn: <a href="https://www.linkedin.com/in/luigipirelli" rel="noreferrer" target="_blank">https://www.linkedin.com/in/lu<wbr>igipirelli</a><br>
    <<a href="https://www.linkedin.com/in/luigipirelli" rel="noreferrer" target="_blank">https://www.linkedin.com/in/l<wbr>uigipirelli</a>><br>
    * Stackexchange:<br>
    <a href="http://gis.stackexchange.com/users/19667/luigi-pirelli" rel="noreferrer" target="_blank">http://gis.stackexchange.com/u<wbr>sers/19667/luigi-pirelli</a><br>
    <<a href="http://gis.stackexchange.com/users/19667/luigi-pirelli" rel="noreferrer" target="_blank">http://gis.stackexchange.com/<wbr>users/19667/luigi-pirelli</a>><br>
    * GitHub: <a href="https://github.com/luipir" rel="noreferrer" target="_blank">https://github.com/luipir</a><br>
    * Mastering QGIS 2nd Edition:<br>
    *<br>
    <a href="https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition" rel="noreferrer" target="_blank">https://www.packtpub.com/big-d<wbr>ata-and-business-intelligence/<wbr>mastering-qgis-second-edition</a><br>
    <<a href="https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition" rel="noreferrer" target="_blank">https://www.packtpub.com/big-<wbr>data-and-business-intelligence<wbr>/mastering-qgis-second-edition</a><wbr>><br>
    ******************************<wbr>******************************<wbr>******************************<wbr>********<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/qgis-developer</a><br>
<br>
</blockquote>
<br>
______________________________<wbr>_________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/qgis-developer</a></blockquote></div></div>