Recently I have posted this same question on it.comp.lang.python, maybe
there aren't solutions, but I'd like to know what you think.

Can doctests be added to nested functions too? (This can be useful to
me, I use nested function when I don't have attributes that I have to
remember, but I want to split the logic in some subparts anyway).
Example:

def foo():
  """
  >>> foo()
  21
  """
  def bar():
    """
    >>> bar()
    11
    """
    print 10
  print 20
import doctest
doctest.testmod()

Bye,
bearophile

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to