module import performance question
Scott D. Daniels
daniels at db-x.com
Wed Nov 12 00:11:13 CET 2003
jeff at cowz.com (Jeff Sykes) wrote in message news:<729b56c7.0311111158.3602e7d5 at posting.google.com>...
> Here's a snip of the block that occured right after import:
> # next line was not there before
> if hasattr(dyn_blocks[key], "BUFFER_ON"):
> I guess the lesson I learned is don't use exception handling
> unnecessarily. Which I know not to do anyway. Sigh. Back to
> school for me.
Wrong lesson. Python wants you to use exception handling.
The time sink above code is the unnecessary uses of:
A couple of Alternatives:
## smaller, not quite careful enough for my taste
## better, more to my taste
flag = dyn_blocks[key].BUFFER_ON
More information about the Python-list