Re: [Tutor] range as a not-quite-iterator

2013-08-03 Thread Steven D'Aprano
On 04/08/13 11:14, Jim Mooney wrote: using py3.3 on win7 I'm reading the Lutz book, and he clearly calls range an iterator in the context of Python 3.0, yet when I try x = range(1,10) next(x) I get: builtins.TypeError: 'range' object is not an iterator And x itself is returned as: range(1, 10)

Re: [Tutor] re module- puzzling results when matching money

2013-08-03 Thread Dominik George
Hi, \b is defined as all non-word characters, so it is the complement oft \w. \w is [A-Za-z0-9_-], so \b includes \$ and thus cuts off your group. -nik Alex Kleider schrieb: >#!/usr/bin/env python > >""" >I've been puzzling over the re module and have a couple of questions >regarding the be

Re: [Tutor] .__mul__

2013-08-03 Thread Dave Angel
Albert-Jan Roskam wrote: > > Thank you. If list.__mul__ is so tricky, why did they implement it the way > they did? Are there situations where this behavior could be useful? > > Btw, this is one of the rare (very, very rare) cases where I find CRAN R > better than Python: Using "multiply"

Re: [Tutor] .__mul__

2013-08-03 Thread Alan Gauld
On 03/08/13 15:50, Albert-Jan Roskam wrote: Suppose I initialize a list (letÅ› say it's a record) to e.g all zeroes, > or all sixes. Suppose, further, that I use "*" for this (which is a nice an clean way). Its only nice if you use it at the top level with an immutable value, otherwise , as