Mercurial > pymonkey
diff docs/src/pymonkey.txt @ 57:a2b617731398
pymonkey.undefined now has a 'falsy' value.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Fri, 10 Jul 2009 18:41:14 -0700 |
parents | 72e84bd75905 |
children | 7a3461ccaf1d |
line wrap: on
line diff
--- a/docs/src/pymonkey.txt Fri Jul 10 17:39:48 2009 -0700 +++ b/docs/src/pymonkey.txt Fri Jul 10 18:41:14 2009 -0700 @@ -25,17 +25,13 @@ >>> cx = pymonkey.Runtime().new_context() >>> cx.evaluate_script(cx.new_object(), '', '<string>', 1) - <type 'pymonkey.undefined'> + pymonkey.undefined - Unfortunately, this object currently does not have a "falsy" value, - e.g.: + This object also has a "falsy" value: - >>> if pymonkey.undefined: - ... print 'Huh, this is kind of unintuitive.' - Huh, this is kind of unintuitive. - - The reason for this is simply that we don't currently know how to - make this object have a falsy value, if it's even possible. + >>> if not pymonkey.undefined: + ... print "See, it's falsy!" + See, it's falsy! .. class:: Object