ent, see
http://docs.python.org/reference/compound_stmts.html#for)
It is clear (imo), and it is seems to be the intended idiom for a search
loop, that short-circuits as soon as a match is found.
Cheers,
--
Nicolas Dandrimont
linux: the choice of a GNU generation
(k...@cis.ufl.edu put this on Tshirts in '93)
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
ouldn't simplify your approach as follows?
>
> for char in word:
> if char in 'aeiouAEIUO':
> return True
> return False
If you want to put this in its own function, this seems to be the way to go.
Cheers,
--
Nicolas Dandrimont
The nice thing about Windows
e 'dict' as a variable name, as it shadows
the built-in 'dict'.
If you really want to obfuscate this, you could use:
my_dict = {1: 'astring', 2: 'anotherstring'}
print "\n".join('Press %i for %s' % (key, value) for key, value
n
> order to produce the correct mathematical result.
Again, the mathematical result is correct. -123^0 is -(123^0), not
(-123)^0.
Regards,
--
Nicolas Dandrimont
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
s. Is that a bug
> in the interpreter perhaps?
The fact is, that triple-quoted strings can span on multiple lines, and
that single-quoted strings cannot (without the line ending with a "\").
So no, it's not a bug in the interpreter.
Regards,
--
Nicolas Dandrimont
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
oted string" (e.g. 'foo' or "bar") is so named by
opposition to triple-quoted (e.g. '''foo''' or """bar""") strings.
Regards,
--
Nicolas Dandrimont
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
ined classes are hashable, by id. You can
override this behaviour by defining the __hash__ special method on
your object.
HTH,
--
Nicolas Dandrimont
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
* Alan G Isaac [2009-07-19 14:46:12 +]:
> Again, my question is about the class not its instances,
> but still, checking as you suggest gives the same answer.
That's what I get for answering before my coffee!
Cheers,
--
Nicolas Dandrimont
"Linux poses a real challenge