0

I am reading Chainer source code and noticed at https://github.com/chainer/chainer/blob/master/chainer/init.py#L7

from chainer import configuration  # NOQA
from chainer import cuda  # NOQA
from chainer import dataset  # NOQA
from chainer import datasets  # NOQA

What does #NOQA mean?

Thanks

Taku
  • 31,927
  • 11
  • 74
  • 85
Daniel
  • 1,428
  • 3
  • 16
  • 35
  • 1
    The duplicate target should be changed to [*What does '# noqa' mean in Python comments?*](https://stackoverflow.com/q/45346575/3357935) – Stevoisiak Jan 30 '18 at 17:09
  • @doelleri's accepted answer is correct. However, you should note that this is on every single line of `__init__.py` because a linter will complain that these imported names are not being used, since they're not referenced anywhere else in this specific file. – Joshua Schlichting Jan 29 '21 at 19:16

1 Answers1

5

# NOQA is an instruction for a linter to ignore checks on that line. Flake8/pep8 will not report on errors from lines ending with this. See the flake8 documentation on ignoring violations for some more details.

doelleri
  • 19,232
  • 5
  • 61
  • 65