diff options
-rw-r--r-- | blessings/__init__.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/blessings/__init__.py b/blessings/__init__.py index b135e01..7df617d 100644 --- a/blessings/__init__.py +++ b/blessings/__init__.py @@ -518,7 +518,12 @@ class NullCallableString(unicode): # determine which of 2 special-purpose classes, # NullParametrizableString or NullFormattingString, to return, and # retire this one. - return u'' + # As a NullCallableString, even when provided with a parameter, + # such as t.color(5), we must also still be callable, fe: + # >>> t.color(5)('shmoo') + # is actually simplified result of NullCallable()(), so + # turtles all the way down: we return another instance. + return NullCallableString() return args[0] # Should we force even strs in Python 2.x to be # unicodes? No. How would I know what encoding to use # to convert it? |