Twenty one nice problems:
http://blogs.pragprog.com/cgi-bin/pragdave.cgi/Practices/Kata
--
http://mail.python.org/mailman/listinfo/python-list
I've found the same bug. This is what I've been doing:
from xml.dom.minidom import Document
try:
from xml.dom.ext import PrettyPrint
except ImportError:
PrettyPrint = None
doc = Document()
...
if PrettyPrint is not None:
PrettyPrint(doc, stream=ou
How about this hack:
>>> import types
>>> class lazy_range(object):
... def __getitem__(self, l):
... start = l[0]
...
... if isinstance(l[1], types.EllipsisType):
... step = 1
... if len(l) > 2:
... stop = l[2]
... else:
...