Hello,
On Wed, Sep 9, 2009 at 4:42 PM, Chris Withers <ch...@simplistix.co.uk>wrote: > > Georg Brandl wrote: > > For Python methods, neither return nor parameter types are supported in > > a special way. (This will change; I intend to allow 3k-style annotations > > at some point which could be used for type info.) > good news :) > > > > One convention, other than simply putting it into the prose, is to put > doc > > fields à la Epydoc into the documentation, like this: > > > > .. function:: foo(x) > > > > :param x: blah > > :rtype: :class:`Bar` > For example, this is what is done in the kaa.base project ( http://doc.freevo.org/api/kaa/base/index.html). For me, the following pages are really beautiful: - http://doc.freevo.org/api/kaa/base/core/io.html - http://doc.freevo.org/api/kaa/base/core/process.html - etc... Examples: ======= in kaa.base.io.py ------------------------ class IOChannel(Object): ... # see the result here: http://doc.freevo.org/api/kaa/base/core/io.html#kaa.IOChannel.read def read(self): """ Reads a chunk of data from the channel. :returns: An :class:`~kaa.InProgress` object. If the InProgress is finished with the empty string, it means that no data was collected and the channel was closed (or the channel was already closed when read() was called). .... """ # see the result here: http://doc.freevo.org/api/kaa/base/core/io.html#kaa.IOChannel class IOChannel(Object): """ Base class for read-only, write-only or read-write descriptors such as Socket and Process. Implements logic common to communication over such channels such as async read/writes and read/write buffering. It may also be used directly with file descriptors or file-like objects. e.g. ``IOChannel(file('somefile'))`` :param channel: file descriptor to wrap into an IOChannel :type channel: integer file descriptor, file-like object, or other IOChannel :param mode: indicates whether the channel is readable, writable, or both. :type mode: bitmask of kaa.IO_READ and/or kaa.IO_WRITE :param chunk_size: maximum number of bytes to be read in from the channel at a time; defaults to 1M. :param delimiter: string used to split data for use with readline; defaults to '\\\\n'. Writes may be performed to an IOChannel that is not yet open. These writes will be queued until the queue size limit (controlled by the :attr:`~kaa.IOChannel.queue_size` property) is reached, after which an exception will be raised. The write queue will be written to the channel once it becomes writable. Reads are asynchronous and non-blocking, and may be performed using two possible approaches: ... """ def __init__(self, channel=None, mode=IO_READ|IO_WRITE, chunk_size=1024*1024, delimiter='\n'): """ ------------------------- -- Patrick Vergain --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-dev@googlegroups.com To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en -~----------~----~----~----~------~----~------~--~---