"is" and ==

T

Terry Reedy

| > | > || Warren Stringer wanted to call the functions just for the side
effects
| > | without interest in the return values. So building a list of return
| > | values which is immediately thrown away is a waste of time and
memory.
| >
| > Also unnecessary: for f in callables: f()
|
| What do you mean?

That if you want to call each of a sequence of proceedures (functions
without a meaning return), as you have indicated and do so again, then the
above is the simple, direct way to do so. Using 'c' instead of
'callables', as in the subject line, would reduce the number of characters

[snip]
| It sounds like list comprehension may be slower because it builds a list
| that never gets used.

A list comprenhension is for building a list that will be used.

| I'm curious if eval statements are faster than def
| statements? Any bytecode experts?

Eval expressions (not statements) and def statements do different things
and hence comparing their speed make no sense to me. In any case, speed
comparisions that you really care about are best done on a particular
target system.

Terry Jan Reedy
 
S

Steve Holden

Warren said:
Oops, forgot to cut and paste the point, to this:


The point is that if the object is ill formed, then you get a traceback
regardless.

But, as this is an addendum to the other post, please read that first.

Now, I really am out of here.
Say, who *was* that masked man? ...

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top