[Hrvoje Nikšić]
> I'd like my rst documents to include snippets of Python that are
> pasteable into the interpreter.
...
> Am I missing an option here?

You can use

    .. include:: source.py
       :literal:

combined with the :start-after: and :end-before: options.

> I find it surprising that a tool written in and for Python

reST is written in Python but is not specifically for Python.  It's a
general-purpose tool.  (Doctest blocks are an exception to the rule; call them a
wart if you like, an early mistake.)

> would make it hard to include valid Python code.  To
> clarify my expectations, I'd expect something (approximately) like
> this to work:
> 
> This text demonstrates creation of a class::
> 
> class Foo(object):
>     pass
> ..
> 
> (The ".." could mark the end of the block.)

It's an interesting idea, worth considering.  It isn't currently implemented 
though.

-- 
David Goodger <http://python.net/~goodger>

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Doc-SIG maillist  -  Doc-SIG@python.org
http://mail.python.org/mailman/listinfo/doc-sig

Reply via email to