Re: good exercises for Beginner

2005-09-26 Thread Roberto De Almeida
Twenty one nice problems: http://blogs.pragprog.com/cgi-bin/pragdave.cgi/Practices/Kata -- http://mail.python.org/mailman/listinfo/python-list

Re: XML and namespaces

2005-11-30 Thread Roberto De Almeida
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

Re: Arithmetic sequences in Python

2006-01-19 Thread Roberto De Almeida
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: ...