[GRASS-dev] pygrass v.import_() strange error

Vaclav Petras wenzeslaus at gmail.com
Wed Aug 1 20:06:21 PDT 2018

On Wed, Aug 1, 2018 at 11:03 AM, Pietro <peter.zamb at gmail.com> wrote:

> Hi Yann,
> On Wed, Jul 25, 2018 at 9:34 AM, Yann Chemin <dr.yann.chemin at gmail.com>
> wrote:
>> v.import_(input=adminfile,output="admin",quiet=True,superquiet=True)
> Why are you interested to execute "v.import_(" instead of "v.import(",
> what is it the purpose of this extra underscore in this case?
> It is quite easy to fix this issue but actually I'm not conviced should be
> fixed.

I think Yann is using shortcuts, not execution by providing module name as
a string, so than "import" is really a keyword:

>>> a = 1
>>> a.real
>>> a.xxx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'int' object has no attribute 'xxx'
>>> a.import()
  File "<stdin>", line 1
SyntaxError: invalid syntax
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20180801/904ba3e2/attachment.html>

More information about the grass-dev mailing list