[C++-sig] Re: Adding __len__ to range objects

David Abrahams dave at boost-consulting.com
Thu Aug 14 15:48:59 CEST 2003


Raoul Gough <RaoulGough at yahoo.co.uk> writes:

> David Abrahams <dave at boost-consulting.com> writes:
> [snip]
>> Anyway, I'm not going to implement this one myself.  Patches
>> (including docs and tests) will be gratefully considered.
>
> OK, I've added len and read-only indexing to boost::python::range,
> dependant on iterator type. I've posted my current progress to
> http://home.clara.net/raoulgough/boost/ - any comments are
> welcome. There is a test script (currently stand-alone) and no docs
> yet. I'll wait a few days to see if anybody suggests any changes
> before advancing.

One other point: I notice you're wondering whether to support slices;
probably you should have a look at Joel's recent indexing suite work.
Maybe once we start to get into range-as-iterable instead of
-as-iterator we should also be handling some of the object lifetime
and iterator validity issues.  If this seems reasonable to you, you
probably ought to talk it over with Joel.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list