]> granicus.if.org Git - python/commitdiff
Backport r66804: #1415508 from Rocky Bernstein: add docstrings for enable_intersperse...
authorAndrew M. Kuchling <amk@amk.ca>
Fri, 14 Nov 2008 00:11:12 +0000 (00:11 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Fri, 14 Nov 2008 00:11:12 +0000 (00:11 +0000)
Lib/optparse.py

index 5aa3b967b07a484ce65a00f1fb3647aaf5dd220e..d41ad3d61e2af8e5bb9b10bb37c126df803c8b81 100644 (file)
@@ -1281,9 +1281,19 @@ class OptionParser (OptionContainer):
             self.usage = usage
 
     def enable_interspersed_args(self):
+        """Set parsing to not stop on the first non-option, allowing
+        interspersing switches with command arguments. This is the
+        default behavior. See also disable_interspersed_args() and the
+        class documentation description of the attribute
+        allow_interspersed_args."""
         self.allow_interspersed_args = True
 
     def disable_interspersed_args(self):
+        """Set parsing to stop on the first non-option. Use this if
+        you have a command processor which runs another command that
+        has options of its own and you want to make sure these options
+        don't get confused.
+        """
         self.allow_interspersed_args = False
 
     def set_process_default_values(self, process):