Commit e58ce01f authored by Hynek Schlawack's avatar Hynek Schlawack

#14804: Remove [] around optional arguments with default values

Mostly just mechanical removal of []. In some rare cases I've pulled the
default value up into the argument list.
parent ed8cf7a5
...@@ -20,7 +20,7 @@ The following exception is defined: ...@@ -20,7 +20,7 @@ The following exception is defined:
The :mod:`bdb` module also defines two classes: The :mod:`bdb` module also defines two classes:
.. class:: Breakpoint(self, file, line[, temporary=0[, cond=None [, funcname=None]]]) .. class:: Breakpoint(self, file, line, temporary=0, cond=None , funcname=None)
This class implements temporary breakpoints, ignore counts, disabling and This class implements temporary breakpoints, ignore counts, disabling and
(re-)enabling, and conditionals. (re-)enabling, and conditionals.
...@@ -245,7 +245,7 @@ The :mod:`bdb` module also defines two classes: ...@@ -245,7 +245,7 @@ The :mod:`bdb` module also defines two classes:
breakpoints. These methods return a string containing an error message if breakpoints. These methods return a string containing an error message if
something went wrong, or ``None`` if all is well. something went wrong, or ``None`` if all is well.
.. method:: set_break(filename, lineno[, temporary=0[, cond[, funcname]]]) .. method:: set_break(filename, lineno, temporary=0, cond=None, funcname=None)
Set a new breakpoint. If the *lineno* line doesn't exist for the Set a new breakpoint. If the *lineno* line doesn't exist for the
*filename* passed as argument, return an error message. The *filename* *filename* passed as argument, return an error message. The *filename*
......
...@@ -162,7 +162,7 @@ The :mod:`csv` module defines the following functions: ...@@ -162,7 +162,7 @@ The :mod:`csv` module defines the following functions:
The :mod:`csv` module defines the following classes: The :mod:`csv` module defines the following classes:
.. class:: DictReader(csvfile[, fieldnames=None[, restkey=None[, restval=None[, dialect='excel'[, *args, **kwds]]]]]) .. class:: DictReader(csvfile, fieldnames=None, restkey=None, restval=None, dialect='excel', *args, **kwds)
Create an object which operates like a regular reader but maps the information Create an object which operates like a regular reader but maps the information
read into a dict whose keys are given by the optional *fieldnames* parameter. read into a dict whose keys are given by the optional *fieldnames* parameter.
...@@ -175,7 +175,7 @@ The :mod:`csv` module defines the following classes: ...@@ -175,7 +175,7 @@ The :mod:`csv` module defines the following classes:
the underlying :class:`reader` instance. the underlying :class:`reader` instance.
.. class:: DictWriter(csvfile, fieldnames[, restval=''[, extrasaction='raise'[, dialect='excel'[, *args, **kwds]]]]) .. class:: DictWriter(csvfile, fieldnames, restval='', extrasaction='raise', dialect='excel', *args, **kwds)
Create an object which operates like a regular writer but maps dictionaries onto Create an object which operates like a regular writer but maps dictionaries onto
output rows. The *fieldnames* parameter identifies the order in which values in output rows. The *fieldnames* parameter identifies the order in which values in
...@@ -219,7 +219,7 @@ The :mod:`csv` module defines the following classes: ...@@ -219,7 +219,7 @@ The :mod:`csv` module defines the following classes:
The :class:`Sniffer` class provides two methods: The :class:`Sniffer` class provides two methods:
.. method:: sniff(sample[, delimiters=None]) .. method:: sniff(sample, delimiters=None)
Analyze the given *sample* and return a :class:`Dialect` subclass Analyze the given *sample* and return a :class:`Dialect` subclass
reflecting the parameters found. If the optional *delimiters* parameter reflecting the parameters found. If the optional *delimiters* parameter
......
...@@ -84,7 +84,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module. ...@@ -84,7 +84,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
The constructor for this class is: The constructor for this class is:
.. function:: __init__([tabsize][, wrapcolumn][, linejunk][, charjunk]) .. function:: __init__(tabsize=8, wrapcolumn=None, linejunk=None, charjunk=IS_CHARACTER_JUNK)
Initializes instance of :class:`HtmlDiff`. Initializes instance of :class:`HtmlDiff`.
...@@ -344,7 +344,7 @@ SequenceMatcher Objects ...@@ -344,7 +344,7 @@ SequenceMatcher Objects
The :class:`SequenceMatcher` class has this constructor: The :class:`SequenceMatcher` class has this constructor:
.. class:: SequenceMatcher([isjunk[, a[, b[, autojunk=True]]]]) .. class:: SequenceMatcher(isjunk=None, a='', b='', autojunk=True)
Optional argument *isjunk* must be ``None`` (the default) or a one-argument Optional argument *isjunk* must be ``None`` (the default) or a one-argument
function that takes a sequence element and returns true if and only if the function that takes a sequence element and returns true if and only if the
......
...@@ -31,7 +31,7 @@ libraries. It allows the program to call arbitrary functions in such a library. ...@@ -31,7 +31,7 @@ libraries. It allows the program to call arbitrary functions in such a library.
The :mod:`dl` module defines the following function: The :mod:`dl` module defines the following function:
.. function:: open(name[, mode=RTLD_LAZY]) .. function:: open(name, mode=RTLD_LAZY)
Open a shared object file, and return a handle. Mode signifies late binding Open a shared object file, and return a handle. Mode signifies late binding
(:const:`RTLD_LAZY`) or immediate binding (:const:`RTLD_NOW`). Default is (:const:`RTLD_LAZY`) or immediate binding (:const:`RTLD_NOW`). Default is
......
...@@ -341,10 +341,10 @@ this module. Most applications will need to derive new writer classes from the ...@@ -341,10 +341,10 @@ this module. Most applications will need to derive new writer classes from the
output. output.
.. class:: DumbWriter([file[, maxcol=72]]) .. class:: DumbWriter(file=None, maxcol=72)
Simple writer class which writes output on the file object passed in as *file* Simple writer class which writes output on the file object passed in as *file*
or, if *file* is omitted, on standard output. The output is simply word-wrapped or, if *file* is None, on standard output. The output is simply word-wrapped
to the number of columns specified by *maxcol*. This class is suitable for to the number of columns specified by *maxcol*. This class is suitable for
reflowing a sequence of paragraphs. reflowing a sequence of paragraphs.
...@@ -354,7 +354,7 @@ available. They are listed here in alphabetical order. ...@@ -354,7 +354,7 @@ available. They are listed here in alphabetical order.
Using :func:`divmod` with complex numbers is deprecated. Using :func:`divmod` with complex numbers is deprecated.
.. function:: enumerate(sequence[, start=0]) .. function:: enumerate(sequence, start=0)
Return an enumerate object. *sequence* must be a sequence, an Return an enumerate object. *sequence* must be a sequence, an
:term:`iterator`, or some other object which supports iteration. The :term:`iterator`, or some other object which supports iteration. The
...@@ -912,7 +912,7 @@ available. They are listed here in alphabetical order. ...@@ -912,7 +912,7 @@ available. They are listed here in alphabetical order.
accidents.) accidents.)
.. function:: print([object, ...][, sep=' '][, end='\\n'][, file=sys.stdout]) .. function:: print([object, ...], sep=' ', end='\\n', file=sys.stdout)
Print *object*\(s) to the stream *file*, separated by *sep* and followed by Print *object*\(s) to the stream *file*, separated by *sep* and followed by
*end*. *sep*, *end* and *file*, if present, must be given as keyword *end*. *sep*, *end* and *file*, if present, must be given as keyword
......
...@@ -89,7 +89,7 @@ The module provides the following classes: ...@@ -89,7 +89,7 @@ The module provides the following classes:
*source_address* was added. *source_address* was added.
.. class:: HTTPResponse(sock[, debuglevel=0][, strict=0]) .. class:: HTTPResponse(sock, debuglevel=0, strict=0)
Class whose instances are returned upon successful connection. Not instantiated Class whose instances are returned upon successful connection. Not instantiated
directly by user. directly by user.
......
...@@ -627,7 +627,7 @@ loops that truncate the stream. ...@@ -627,7 +627,7 @@ loops that truncate the stream.
break break
.. function:: tee(iterable[, n=2]) .. function:: tee(iterable, n=2)
Return *n* independent iterators from a single iterable. Equivalent to:: Return *n* independent iterators from a single iterable. Equivalent to::
......
...@@ -154,7 +154,7 @@ Maildir, mbox, MH, Babyl, and MMDF. ...@@ -154,7 +154,7 @@ Maildir, mbox, MH, Babyl, and MMDF.
when the :class:`Mailbox` instance was initialized. when the :class:`Mailbox` instance was initialized.
.. method:: get(key[, default=None]) .. method:: get(key, default=None)
__getitem__(key) __getitem__(key)
Return a representation of the message corresponding to *key*. If no such Return a representation of the message corresponding to *key*. If no such
...@@ -278,7 +278,7 @@ Maildir, mbox, MH, Babyl, and MMDF. ...@@ -278,7 +278,7 @@ Maildir, mbox, MH, Babyl, and MMDF.
^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
.. class:: Maildir(dirname[, factory=rfc822.Message[, create=True]]) .. class:: Maildir(dirname, factory=rfc822.Message, create=True)
A subclass of :class:`Mailbox` for mailboxes in Maildir format. Parameter A subclass of :class:`Mailbox` for mailboxes in Maildir format. Parameter
*factory* is a callable object that accepts a file-like message representation *factory* is a callable object that accepts a file-like message representation
...@@ -423,7 +423,7 @@ Maildir, mbox, MH, Babyl, and MMDF. ...@@ -423,7 +423,7 @@ Maildir, mbox, MH, Babyl, and MMDF.
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
.. class:: mbox(path[, factory=None[, create=True]]) .. class:: mbox(path, factory=None, create=True)
A subclass of :class:`Mailbox` for mailboxes in mbox format. Parameter *factory* A subclass of :class:`Mailbox` for mailboxes in mbox format. Parameter *factory*
is a callable object that accepts a file-like message representation (which is a callable object that accepts a file-like message representation (which
...@@ -483,7 +483,7 @@ Maildir, mbox, MH, Babyl, and MMDF. ...@@ -483,7 +483,7 @@ Maildir, mbox, MH, Babyl, and MMDF.
^^^^^^^^^^^ ^^^^^^^^^^^
.. class:: MH(path[, factory=None[, create=True]]) .. class:: MH(path, factory=None, create=True)
A subclass of :class:`Mailbox` for mailboxes in MH format. Parameter *factory* A subclass of :class:`Mailbox` for mailboxes in MH format. Parameter *factory*
is a callable object that accepts a file-like message representation (which is a callable object that accepts a file-like message representation (which
...@@ -613,7 +613,7 @@ Maildir, mbox, MH, Babyl, and MMDF. ...@@ -613,7 +613,7 @@ Maildir, mbox, MH, Babyl, and MMDF.
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
.. class:: Babyl(path[, factory=None[, create=True]]) .. class:: Babyl(path, factory=None, create=True)
A subclass of :class:`Mailbox` for mailboxes in Babyl format. Parameter A subclass of :class:`Mailbox` for mailboxes in Babyl format. Parameter
*factory* is a callable object that accepts a file-like message representation *factory* is a callable object that accepts a file-like message representation
...@@ -689,7 +689,7 @@ Maildir, mbox, MH, Babyl, and MMDF. ...@@ -689,7 +689,7 @@ Maildir, mbox, MH, Babyl, and MMDF.
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
.. class:: MMDF(path[, factory=None[, create=True]]) .. class:: MMDF(path, factory=None, create=True)
A subclass of :class:`Mailbox` for mailboxes in MMDF format. Parameter *factory* A subclass of :class:`Mailbox` for mailboxes in MMDF format. Parameter *factory*
is a callable object that accepts a file-like message representation (which is a callable object that accepts a file-like message representation (which
...@@ -987,7 +987,7 @@ When a :class:`MaildirMessage` instance is created based upon a ...@@ -987,7 +987,7 @@ When a :class:`MaildirMessage` instance is created based upon a
are excluded. are excluded.
.. method:: set_from(from_[, time_=None]) .. method:: set_from(from_, time_=None)
Set the "From " line to *from_*, which should be specified without a Set the "From " line to *from_*, which should be specified without a
leading "From " or trailing newline. For convenience, *time_* may be leading "From " or trailing newline. For convenience, *time_* may be
...@@ -1358,7 +1358,7 @@ When a :class:`BabylMessage` instance is created based upon an ...@@ -1358,7 +1358,7 @@ When a :class:`BabylMessage` instance is created based upon an
are excluded. are excluded.
.. method:: set_from(from_[, time_=None]) .. method:: set_from(from_, time_=None)
Set the "From " line to *from_*, which should be specified without a Set the "From " line to *from_*, which should be specified without a
leading "From " or trailing newline. For convenience, *time_* may be leading "From " or trailing newline. For convenience, *time_* may be
......
...@@ -1181,7 +1181,7 @@ Files and Directories ...@@ -1181,7 +1181,7 @@ Files and Directories
doesn't open the FIFO --- it just creates the rendezvous point. doesn't open the FIFO --- it just creates the rendezvous point.
.. function:: mknod(filename[, mode=0600, device]) .. function:: mknod(filename, mode=0600, device=0)
Create a filesystem node (file, device special file or named pipe) named Create a filesystem node (file, device special file or named pipe) named
*filename*. *mode* specifies both the permissions to use and the type of node to *filename*. *mode* specifies both the permissions to use and the type of node to
...@@ -1583,7 +1583,7 @@ Files and Directories ...@@ -1583,7 +1583,7 @@ Files and Directories
Availability: Unix, Windows. Availability: Unix, Windows.
.. function:: walk(top[, topdown=True [, onerror=None[, followlinks=False]]]) .. function:: walk(top, topdown=True, onerror=None, followlinks=False)
.. index:: .. index::
single: directory; walking single: directory; walking
......
...@@ -275,7 +275,7 @@ The following convenience methods combine several ioctls, or one ioctl and some ...@@ -275,7 +275,7 @@ The following convenience methods combine several ioctls, or one ioctl and some
simple calculations. simple calculations.
.. method:: oss_audio_device.setparameters(format, nchannels, samplerate [, strict=False]) .. method:: oss_audio_device.setparameters(format, nchannels, samplerate, strict=False)
Set the key audio sampling parameters---sample format, number of channels, and Set the key audio sampling parameters---sample format, number of channels, and
sampling rate---in one method call. *format*, *nchannels*, and *samplerate* sampling rate---in one method call. *format*, *nchannels*, and *samplerate*
......
...@@ -200,7 +200,7 @@ numbering information. ...@@ -200,7 +200,7 @@ numbering information.
information is omitted if the flag is false or omitted. information is omitted if the flag is false or omitted.
.. function:: compilest(ast[, filename='<syntax-tree>']) .. function:: compilest(ast, filename='<syntax-tree>')
.. index:: builtin: eval .. index:: builtin: eval
......
...@@ -20,7 +20,7 @@ useful for Python core developers who are working on the :mod:`pickle` and ...@@ -20,7 +20,7 @@ useful for Python core developers who are working on the :mod:`pickle` and
probably won't find the :mod:`pickletools` module relevant. probably won't find the :mod:`pickletools` module relevant.
.. function:: dis(pickle[, out=None, memo=None, indentlevel=4]) .. function:: dis(pickle, out=None, memo=None, indentlevel=4)
Outputs a symbolic disassembly of the pickle to the file-like object *out*, Outputs a symbolic disassembly of the pickle to the file-like object *out*,
defaulting to ``sys.stdout``. *pickle* can be a string or a file-like object. defaulting to ``sys.stdout``. *pickle* can be a string or a file-like object.
......
...@@ -74,7 +74,7 @@ This module defines the following functions: ...@@ -74,7 +74,7 @@ This module defines the following functions:
.. function:: readPlistFromResource(path[, restype='plst'[, resid=0]]) .. function:: readPlistFromResource(path, restype='plst', resid=0)
Read a plist from the resource with type *restype* from the resource fork of Read a plist from the resource with type *restype* from the resource fork of
*path*. Availability: Mac OS X. *path*. Availability: Mac OS X.
...@@ -84,7 +84,7 @@ This module defines the following functions: ...@@ -84,7 +84,7 @@ This module defines the following functions:
In Python 3.x, this function has been removed. In Python 3.x, this function has been removed.
.. function:: writePlistToResource(rootObject, path[, restype='plst'[, resid=0]]) .. function:: writePlistToResource(rootObject, path, restype='plst', resid=0)
Write *rootObject* as a resource with type *restype* to the resource fork of Write *rootObject* as a resource with type *restype* to the resource fork of
*path*. Availability: Mac OS X. *path*. Availability: Mac OS X.
......
...@@ -298,7 +298,7 @@ Analysis of the profiler data is done using the :class:`Stats` class. ...@@ -298,7 +298,7 @@ Analysis of the profiler data is done using the :class:`Stats` class.
:synopsis: Statistics object for use with the profiler. :synopsis: Statistics object for use with the profiler.
.. class:: Stats(filename[, stream=sys.stdout[, ...]]) .. class:: Stats(filename, stream=sys.stdout[, ...])
This class constructor creates an instance of a "statistics object" from a This class constructor creates an instance of a "statistics object" from a
*filename* (or set of filenames). :class:`Stats` objects are manipulated by *filename* (or set of filenames). :class:`Stats` objects are manipulated by
......
...@@ -19,7 +19,7 @@ not implemented in Python, including all standard and optional extension ...@@ -19,7 +19,7 @@ not implemented in Python, including all standard and optional extension
modules. modules.
.. function:: readmodule(module[, path=None]) .. function:: readmodule(module, path=None)
Read a module and return a dictionary mapping class names to class Read a module and return a dictionary mapping class names to class
descriptor objects. The parameter *module* should be the name of a descriptor objects. The parameter *module* should be the name of a
...@@ -28,7 +28,7 @@ modules. ...@@ -28,7 +28,7 @@ modules.
of ``sys.path``, which is used to locate module source code. of ``sys.path``, which is used to locate module source code.
.. function:: readmodule_ex(module[, path=None]) .. function:: readmodule_ex(module, path=None)
Like :func:`readmodule`, but the returned dictionary, in addition to Like :func:`readmodule`, but the returned dictionary, in addition to
mapping class names to class descriptor objects, also maps top-level mapping class names to class descriptor objects, also maps top-level
......
...@@ -18,7 +18,7 @@ This includes most class instances, recursive data types, and objects containing ...@@ -18,7 +18,7 @@ This includes most class instances, recursive data types, and objects containing
lots of shared sub-objects. The keys are ordinary strings. lots of shared sub-objects. The keys are ordinary strings.
.. function:: open(filename[, flag='c'[, protocol=None[, writeback=False]]]) .. function:: open(filename, flag='c', protocol=None, writeback=False)
Open a persistent dictionary. The filename specified is the base filename for Open a persistent dictionary. The filename specified is the base filename for
the underlying database. As a side-effect, an extension may be added to the the underlying database. As a side-effect, an extension may be added to the
...@@ -100,7 +100,7 @@ Restrictions ...@@ -100,7 +100,7 @@ Restrictions
implementation used. implementation used.
.. class:: Shelf(dict[, protocol=None[, writeback=False]]) .. class:: Shelf(dict, protocol=None, writeback=False)
A subclass of :class:`UserDict.DictMixin` which stores pickled values in the A subclass of :class:`UserDict.DictMixin` which stores pickled values in the
*dict* object. *dict* object.
...@@ -118,7 +118,7 @@ Restrictions ...@@ -118,7 +118,7 @@ Restrictions
memory and make sync and close take a long time. memory and make sync and close take a long time.
.. class:: BsdDbShelf(dict[, protocol=None[, writeback=False]]) .. class:: BsdDbShelf(dict, protocol=None, writeback=False)
A subclass of :class:`Shelf` which exposes :meth:`first`, :meth:`!next`, A subclass of :class:`Shelf` which exposes :meth:`first`, :meth:`!next`,
:meth:`previous`, :meth:`last` and :meth:`set_location` which are available in :meth:`previous`, :meth:`last` and :meth:`set_location` which are available in
...@@ -129,7 +129,7 @@ Restrictions ...@@ -129,7 +129,7 @@ Restrictions
the same interpretation as for the :class:`Shelf` class. the same interpretation as for the :class:`Shelf` class.
.. class:: DbfilenameShelf(filename[, flag='c'[, protocol=None[, writeback=False]]]) .. class:: DbfilenameShelf(filename, flag='c', protocol=None, writeback=False)
A subclass of :class:`Shelf` which accepts a *filename* instead of a dict-like A subclass of :class:`Shelf` which accepts a *filename* instead of a dict-like
object. The underlying file will be opened using :func:`anydbm.open`. By object. The underlying file will be opened using :func:`anydbm.open`. By
......
...@@ -96,7 +96,7 @@ Directory and files operations ...@@ -96,7 +96,7 @@ Directory and files operations
.. versionadded:: 2.6 .. versionadded:: 2.6
.. function:: copytree(src, dst[, symlinks=False[, ignore=None]]) .. function:: copytree(src, dst, symlinks=False, ignore=None)
Recursively copy an entire directory tree rooted at *src*. The destination Recursively copy an entire directory tree rooted at *src*. The destination
directory, named by *dst*, must not already exist; it will be created as directory, named by *dst*, must not already exist; it will be created as
......
...@@ -386,7 +386,7 @@ The :mod:`struct` module also defines the following type: ...@@ -386,7 +386,7 @@ The :mod:`struct` module also defines the following type:
(``len(string)`` must equal :attr:`self.size`). (``len(string)`` must equal :attr:`self.size`).
.. method:: unpack_from(buffer[, offset=0]) .. method:: unpack_from(buffer, offset=0)
Identical to the :func:`unpack_from` function, using the compiled format. Identical to the :func:`unpack_from` function, using the compiled format.
(``len(buffer[offset:])`` must be at least :attr:`self.size`). (``len(buffer[offset:])`` must be at least :attr:`self.size`).
......
...@@ -114,7 +114,7 @@ The module also defines three convenience functions: ...@@ -114,7 +114,7 @@ The module also defines three convenience functions:
time. This means that other processes running on the same computer may time. This means that other processes running on the same computer may
interfere with the timing. interfere with the timing.
.. function:: repeat(stmt[, setup[, timer[, repeat=3 [, number=1000000]]]]) .. function:: repeat(stmt, setup='pass', timer=default_timer, repeat=3 , number=1000000)
Create a :class:`Timer` instance with the given statement, setup code and timer Create a :class:`Timer` instance with the given statement, setup code and timer
function and run its :meth:`repeat` method with the given repeat count and function and run its :meth:`repeat` method with the given repeat count and
...@@ -123,7 +123,7 @@ The module also defines three convenience functions: ...@@ -123,7 +123,7 @@ The module also defines three convenience functions:
.. versionadded:: 2.6 .. versionadded:: 2.6
.. function:: timeit(stmt[, setup[, timer[, number=1000000]]]) .. function:: timeit(stmt, setup='pass', timer=default_timer, number=1000000)
Create a :class:`Timer` instance with the given statement, setup code and timer Create a :class:`Timer` instance with the given statement, setup code and timer
function and run its :meth:`timeit` method with *number* executions. function and run its :meth:`timeit` method with *number* executions.
......
...@@ -149,7 +149,7 @@ Programmatic Interface ...@@ -149,7 +149,7 @@ Programmatic Interface
the current tracing parameters. *cmd* must be a string or code object, the current tracing parameters. *cmd* must be a string or code object,
suitable for passing into :func:`exec`. suitable for passing into :func:`exec`.
.. method:: runctx(cmd[, globals=None[, locals=None]]) .. method:: runctx(cmd, globals=None, locals=None)
Execute the command and gather statistics from the execution with the Execute the command and gather statistics from the execution with the
current tracing parameters, in the defined global and local current tracing parameters, in the defined global and local
......
...@@ -265,7 +265,7 @@ Besides the methods described below, the :class:`ttk.Widget` class supports the ...@@ -265,7 +265,7 @@ Besides the methods described below, the :class:`ttk.Widget` class supports the
*x* and *y* are pixel coordinates relative to the widget. *x* and *y* are pixel coordinates relative to the widget.
.. method:: instate(statespec[, callback=None[, *args[, **kw]]]) .. method:: instate(statespec, callback=None, *args, **kw)
Test the widget's state. If a callback is not specified, returns True Test the widget's state. If a callback is not specified, returns True
if the widget state matches *statespec* and False otherwise. If callback if the widget state matches *statespec* and False otherwise. If callback
...@@ -523,7 +523,7 @@ ttk.Notebook ...@@ -523,7 +523,7 @@ ttk.Notebook
omitted, returns the widget name of the currently selected pane. omitted, returns the widget name of the currently selected pane.
.. method:: tab(tab_id[, option=None[, **kw]]) .. method:: tab(tab_id, option=None, **kw)
Query or modify the options of the specific *tab_id*. Query or modify the options of the specific *tab_id*.
...@@ -846,7 +846,7 @@ ttk.Treeview ...@@ -846,7 +846,7 @@ ttk.Treeview
.. class:: Treeview .. class:: Treeview
.. method:: bbox(item[, column=None]) .. method:: bbox(item, column=None)
Returns the bounding box (relative to the treeview widget's window) of Returns the bounding box (relative to the treeview widget's window) of
the specified *item* in the form (x, y, width, height). the specified *item* in the form (x, y, width, height).
...@@ -873,7 +873,7 @@ ttk.Treeview ...@@ -873,7 +873,7 @@ ttk.Treeview
*item*'s children. *item*'s children.
.. method:: column(column[, option=None[, **kw]]) .. method:: column(column, option=None, **kw)
Query or modify the options for the specified *column*. Query or modify the options for the specified *column*.
...@@ -928,7 +928,7 @@ ttk.Treeview ...@@ -928,7 +928,7 @@ ttk.Treeview
the current focus item, or '' if there is none. the current focus item, or '' if there is none.
.. method:: heading(column[, option=None[, **kw]]) .. method:: heading(column, option=None, **kw)
Query or modify the heading options for the specified *column*. Query or modify the heading options for the specified *column*.
...@@ -1001,7 +1001,7 @@ ttk.Treeview ...@@ -1001,7 +1001,7 @@ ttk.Treeview
Returns the integer index of *item* within its parent's list of children. Returns the integer index of *item* within its parent's list of children.
.. method:: insert(parent, index[, iid=None[, **kw]]) .. method:: insert(parent, index, iid=None, **kw)
Creates a new item and returns the item identifier of the newly created Creates a new item and returns the item identifier of the newly created
item. item.
...@@ -1096,7 +1096,7 @@ ttk.Treeview ...@@ -1096,7 +1096,7 @@ ttk.Treeview
Toggle the selection state of each item in *items*. Toggle the selection state of each item in *items*.
.. method:: set(item[, column=None[, value=None]]) .. method:: set(item, column=None, value=None)
With one argument, returns a dictionary of column/value pairs for the With one argument, returns a dictionary of column/value pairs for the
specified *item*. With two arguments, returns the current value of the specified *item*. With two arguments, returns the current value of the
...@@ -1104,14 +1104,14 @@ ttk.Treeview ...@@ -1104,14 +1104,14 @@ ttk.Treeview
*column* in given *item* to the specified *value*. *column* in given *item* to the specified *value*.
.. method:: tag_bind(tagname[, sequence=None[, callback=None]]) .. method:: tag_bind(tagname, sequence=None, callback=None)
Bind a callback for the given event *sequence* to the tag *tagname*. Bind a callback for the given event *sequence* to the tag *tagname*.
When an event is delivered to an item, the callbacks for each of the When an event is delivered to an item, the callbacks for each of the
item's tags option are called. item's tags option are called.
.. method:: tag_configure(tagname[, option=None[, **kw]]) .. method:: tag_configure(tagname, option=None, **kw)
Query or modify the options for the specified *tagname*. Query or modify the options for the specified *tagname*.
...@@ -1220,7 +1220,7 @@ option. If the class name of a widget is unknown, use the method ...@@ -1220,7 +1220,7 @@ option. If the class name of a widget is unknown, use the method
foreground option, for example, you would get a blue foreground foreground option, for example, you would get a blue foreground
when the widget is in the active or pressed states. when the widget is in the active or pressed states.
.. method:: lookup(style, option[, state=None[, default=None]]) .. method:: lookup(style, option, state=None, default=None)
Returns the value specified for *option* in *style*. Returns the value specified for *option* in *style*.
...@@ -1235,7 +1235,7 @@ option. If the class name of a widget is unknown, use the method ...@@ -1235,7 +1235,7 @@ option. If the class name of a widget is unknown, use the method
print ttk.Style().lookup("TButton", "font") print ttk.Style().lookup("TButton", "font")
.. method:: layout(style[, layoutspec=None]) .. method:: layout(style, layoutspec=None)
Define the widget layout for given *style*. If *layoutspec* is omitted, Define the widget layout for given *style*. If *layoutspec* is omitted,
return the layout specification for given style. return the layout specification for given style.
...@@ -1318,7 +1318,7 @@ option. If the class name of a widget is unknown, use the method ...@@ -1318,7 +1318,7 @@ option. If the class name of a widget is unknown, use the method
Returns the list of *elementname*'s options. Returns the list of *elementname*'s options.
.. method:: theme_create(themename[, parent=None[, settings=None]]) .. method:: theme_create(themename, parent=None, settings=None)
Create a new theme. Create a new theme.
......
...@@ -48,7 +48,7 @@ The following exception is defined: ...@@ -48,7 +48,7 @@ The following exception is defined:
The following functions are defined: The following functions are defined:
.. function:: open(url[, new=0[, autoraise=True]]) .. function:: open(url, new=0, autoraise=True)
Display *url* using the default browser. If *new* is 0, the *url* is opened Display *url* using the default browser. If *new* is 0, the *url* is opened
in the same browser window if possible. If *new* is 1, a new browser window in the same browser window if possible. If *new* is 1, a new browser window
...@@ -178,7 +178,7 @@ Browser controllers provide these methods which parallel three of the ...@@ -178,7 +178,7 @@ Browser controllers provide these methods which parallel three of the
module-level convenience functions: module-level convenience functions:
.. method:: controller.open(url[, new=0[, autoraise=True]]) .. method:: controller.open(url, new=0, autoraise=True)
Display *url* using the browser handled by this controller. If *new* is 1, a new Display *url* using the browser handled by this controller. If *new* is 1, a new
browser window is opened if possible. If *new* is 2, a new browser page ("tab") browser window is opened if possible. If *new* is 2, a new browser page ("tab")
......
...@@ -59,7 +59,7 @@ parameter expect a WSGI-compliant dictionary to be supplied; please see ...@@ -59,7 +59,7 @@ parameter expect a WSGI-compliant dictionary to be supplied; please see
found, and "http" otherwise. found, and "http" otherwise.
.. function:: request_uri(environ [, include_query=1]) .. function:: request_uri(environ, include_query=1)
Return the full request URI, optionally including the query string, using the Return the full request URI, optionally including the query string, using the
algorithm found in the "URL Reconstruction" section of :pep:`333`. If algorithm found in the "URL Reconstruction" section of :pep:`333`. If
...@@ -148,7 +148,7 @@ also provides these miscellaneous utilities: ...@@ -148,7 +148,7 @@ also provides these miscellaneous utilities:
:rfc:`2616`. :rfc:`2616`.
.. class:: FileWrapper(filelike [, blksize=8192]) .. class:: FileWrapper(filelike, blksize=8192)
A wrapper to convert a file-like object to an :term:`iterator`. The resulting objects A wrapper to convert a file-like object to an :term:`iterator`. The resulting objects
support both :meth:`__getitem__` and :meth:`__iter__` iteration styles, for support both :meth:`__getitem__` and :meth:`__iter__` iteration styles, for
...@@ -271,7 +271,7 @@ request. (E.g., using the :func:`shift_path_info` function from ...@@ -271,7 +271,7 @@ request. (E.g., using the :func:`shift_path_info` function from
:mod:`wsgiref.util`.) :mod:`wsgiref.util`.)
.. function:: make_server(host, port, app [, server_class=WSGIServer [, handler_class=WSGIRequestHandler]]) .. function:: make_server(host, port, app, server_class=WSGIServer, handler_class=WSGIRequestHandler)
Create a new WSGI server listening on *host* and *port*, accepting connections Create a new WSGI server listening on *host* and *port*, accepting connections
for *app*. The return value is an instance of the supplied *server_class*, and for *app*. The return value is an instance of the supplied *server_class*, and
...@@ -460,7 +460,7 @@ input, output, and error streams. ...@@ -460,7 +460,7 @@ input, output, and error streams.
environment. environment.
.. class:: BaseCGIHandler(stdin, stdout, stderr, environ [, multithread=True [, multiprocess=False]]) .. class:: BaseCGIHandler(stdin, stdout, stderr, environ, multithread=True, multiprocess=False)
Similar to :class:`CGIHandler`, but instead of using the :mod:`sys` and Similar to :class:`CGIHandler`, but instead of using the :mod:`sys` and
:mod:`os` modules, the CGI environment and I/O streams are specified explicitly. :mod:`os` modules, the CGI environment and I/O streams are specified explicitly.
...@@ -475,7 +475,7 @@ input, output, and error streams. ...@@ -475,7 +475,7 @@ input, output, and error streams.
instead of :class:`SimpleHandler`. instead of :class:`SimpleHandler`.
.. class:: SimpleHandler(stdin, stdout, stderr, environ [,multithread=True [, multiprocess=False]]) .. class:: SimpleHandler(stdin, stdout, stderr, environ, multithread=True, multiprocess=False)
Similar to :class:`BaseCGIHandler`, but designed for use with HTTP origin Similar to :class:`BaseCGIHandler`, but designed for use with HTTP origin
servers. If you are writing an HTTP server implementation, you will probably servers. If you are writing an HTTP server implementation, you will probably
......
...@@ -129,7 +129,7 @@ module documentation. This section lists the differences between the API and ...@@ -129,7 +129,7 @@ module documentation. This section lists the differences between the API and
to discard children of that node. to discard children of that node.
.. method:: Node.writexml(writer[, indent=""[, addindent=""[, newl=""]]]) .. method:: Node.writexml(writer, indent="", addindent="", newl="")
Write XML to the writer object. The writer should have a :meth:`write` method Write XML to the writer object. The writer should have a :meth:`write` method
which matches that of the file object interface. The *indent* parameter is the which matches that of the file object interface. The *indent* parameter is the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment