diff options
author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-04-16 20:38:56 -0500 |
---|---|---|
committer | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-04-16 20:38:56 -0500 |
commit | f14f141d9ce4a14be98682bca0a42cbbe9175e01 (patch) | |
tree | d854e63b59748483aee50e3537996ea04f2fc922 | |
parent | 35202296d13f01e6a45e44abe4a5f6305506588c (diff) | |
download | pystache-f14f141d9ce4a14be98682bca0a42cbbe9175e01.tar.gz |
Added a TODO to pystache/context.py to use EAFP instead of a global variable.
-rw-r--r-- | pystache/context.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pystache/context.py b/pystache/context.py index d009fdf..a8f3964 100644 --- a/pystache/context.py +++ b/pystache/context.py @@ -13,6 +13,10 @@ _BUILTIN_MODULE = type(0).__module__ # not being found on lookup. This lets us distinguish between the case # of a key's value being None with the case of a key not being found -- # without having to rely on exceptions (e.g. KeyError) for flow control. +# +# TODO: eliminate the need for a private global variable, e.g. by using the +# preferred Python approach of "easier to ask for forgiveness than permission": +# http://docs.python.org/glossary.html#term-eafp class NotFound(object): pass _NOT_FOUND = NotFound() |