]> granicus.if.org Git - python/commitdiff
#4827: fix callback example.
authorGeorg Brandl <georg@python.org>
Thu, 5 Feb 2009 11:33:21 +0000 (11:33 +0000)
committerGeorg Brandl <georg@python.org>
Thu, 5 Feb 2009 11:33:21 +0000 (11:33 +0000)
Doc/library/optparse.rst

index 604ac7f8592935eaed4207573bf6c7881833185b..4ef2ba7eb8409d962c2e57dba363c0ce6166993d 100644 (file)
@@ -1511,7 +1511,7 @@ Here's an example of a callback option that takes no arguments, and simply
 records that the option was seen::
 
    def record_foo_seen(option, opt_str, value, parser):
-       parser.saw_foo = True
+       parser.values.saw_foo = True
 
    parser.add_option("--foo", action="callback", callback=record_foo_seen)