[Python-Dev] Re: Sets: elt in dict, lst.include

Eric S. Raymond esr@thyrsus.com
Mon, 29 Jan 2001 15:09:14 -0500


M.-A. Lemburg <mal@lemburg.com>:
> If you are looking for speedups w/r to for-loops, applying a
> different indexing technique in for-loops would go a lot further
> and provide better performance not only to dictionary loops,
> but also to other sequences.

Which reminds me...

There's not much I miss from C these days, but one thing I wish Python
had is a more general for-loop.  The C semantics that let you have 
any initialization, any termination test, and any iteration you like
are rather cool.

Yes, I realize that

	for (<init>; <test>; <step>) {<body>}

can be simulated with:

	<init>
	while 1:
		if <test>:
			break
		<body> 

Still, having them spatially grouped the way a C for does it is nice.
Makes it easier to see invariants, I think.
-- 
		<a href="http://www.tuxedo.org/~esr/">Eric S. Raymond</a>

"Rightful liberty is unobstructed action, according to our will, within limits
drawn around us by the equal rights of others."
	-- Thomas Jefferson