pylint style convention

Ben Finney bignose+hates-spam at benfinney.id.au
Tue Jul 24 00:24:00 EDT 2007


mick at cs.wisc.edu (Mick Charles Beaver) writes:

> Here's a snippet:

pylint is reporting line numbers. Can you show us line numbers for
this snippet?

> #======================================================================
> if __name__ == '__main__':
>     parser = optparse.OptionParser(usage='usage: %prog [OPTIONS]')
>     parser.add_option('-c', '--config',
>                       action='store',
>                       type='string',
>                       dest='configFilename',
>                       help='config file containing defaults')
>     (options, args) = parser.parse_args()
> #======================================================================
> 
> Now, PyLint reports the following convention warnings:
> C:158: Invalid name "parser" (should match (([A-Z_][A-Z1-9_]*)|(__.*__))$)
> C:170: Invalid name "options" (should match (([A-Z_][A-Z1-9_]*)|(__.*__))$)
> C:170: Invalid name "args" (should match (([A-Z_][A-Z1-9_]*)|(__.*__))$)

These warnings are for line 158 and line 170, which covers a range of
13 lines. Your code snippet is only 8 lines long. So at least one of
those two lines that have warnings reported are not in the code you've
shown to us.

-- 
 \                "Too many Indians spoil the golden egg."  -- Sir Joh |
  `\                                                   Bjelke-Petersen |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list