submitter 559630 !
clone 559630 -1
reassign -1 python2.7-doc 2.7-2
retitle 1 python2.7-doc: indentation error in documentation example
thanks

* Jakub Wilk, 2009-12-05, 22:05:
$ grep 'class FooAction' -A4 doc/source/add_argument.rst | cut -c 3-
class FooAction(argparse.Action):
...     def __call__(self, parser, namespace, values, option_string=None):
...     print '%r %r %r' % (namespace, values, option_string)
...     setattr(namespace, self.dest, values)
...

This example is obviously incorrect:

$ python
class FooAction(argparse.Action):
...     def __call__(self, parser, namespace, values, option_string=None):
...     print '%r %r %r' % (namespace, values, option_string)
 File "<stdin>", line 3
   print '%r %r %r' % (namespace, values, option_string)
       ^
IndentationError: expected an indented block

The same bug exists in python2.7-doc, in library/argparse.html, at the bottom of 15.4.3.2.

--
Jakub Wilk

Attachment: signature.asc
Description: Digital signature

Reply via email to