Michael Powe wrote:
Clash of the Titans
From "Dive into Python":
__init__ is called immediately after an instance of the class is
created. It would be tempting but incorrect to call this the
constructor of the class. It's tempting, because it looks like a
constructor (by convention, __init__ is the
Alan Gauld wrote:
By missing out a loop(*) and some splits it should speed up
significantly for the cost of some small added complexity in building
the dictionaries in the first case.
(*)In fact 3 loops because you aren't doing len() which effectively
loops over the collection too.
It this cor
Chad Crabtree wrote:
The only problem with this if it is to big or to deeply nested then
it
will overflow the stack?
Danny Yoo has given a mind-blowing continuation implementation that will
not overflow the stack. Below goes a recursive-iterator implementation.
To avoid deep recursion the code
Patrick Hall wrote:
Hi Dave,
I have a list consisting of about 250 items, I need to know if a
particular item is in the list. I know this is better suited to a
dictionary but thats not the way it ended up ;-)
I could do a for loop to scan the list & compare each one, but I have a
suspission that
Jacob S. wrote:
I hate to sound weird...
But who are you all, what are you're ages, what do you do, marriage status,
etc?
You obviously don't have to answer, I'm just curious who I'm boldly sending
emails to.
Jacob Schmidt
P.S.
I'm a student. 14 years. Play the piano better than I write scripts. Si
Loptr Chaote wrote:
On Wed, 15 Dec 2004 19:58:56 -0500, Brian van den Broek
1) Every operation has a return value [unless purposefully left out]
This includes, but is not limited to; mathematical operations (of
course), variable assignment, compare blocks, etc..
A small correction: every function h
Bill Campbell wrote:
On Sat, Dec 04, 2004, Alan Gauld wrote:
I'm having trouble understanding the difference between eval and
exec.
eval evaluates an *expression* - that is something that returns a
value.
...
Both are extremely dangerous functions from a security
and maintenance/reliability pouint