Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82266

Re: Nested loops is strangely slow, totally at a loss.

References <mailman.16794.1418188833.18130.python-list@python.org> <5487ebc7$0$2817$c3e8da3$76491128@news.astraweb.com>
Date 2014-12-10 17:53 +1100
Subject Re: Nested loops is strangely slow, totally at a loss.
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.16798.1418194395.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Dec 10, 2014 at 5:44 PM, Steven D'Aprano <steve@pearwood.info> wrote:
> It would be nice if product iterators behaved like xrange() objects and
> could perform "in" tests without exhausting the iterator, but they don't.
> That's sad.

It'd be very difficult to do that in the general sense. But it should
be possible to have a multi-dimensional range object that behaves the
way Py3's range object does, including membership tests and stuff.
(Might already exist, for all I know.) That would do what the OP
wants, I think.

ChrisA

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Nested loops is strangely slow, totally at a loss. Shiyao Ma <i@introo.me> - 2014-12-10 13:20 +0800
  Re: Nested loops is strangely slow, totally at a loss. Steven D'Aprano <steve@pearwood.info> - 2014-12-10 06:44 +0000
    Re: Nested loops is strangely slow, totally at a loss. Chris Angelico <rosuav@gmail.com> - 2014-12-10 17:53 +1100
      Re: Nested loops is strangely slow, totally at a loss. Steven D'Aprano <steve@pearwood.info> - 2014-12-10 07:21 +0000
    Re: Nested loops is strangely slow, totally at a loss. Terry Reedy <tjreedy@udel.edu> - 2014-12-10 02:16 -0500

csiph-web