Default to 'full' content in __format__

...when no explicit content argument is given
This commit is contained in:
Andrew Scheller
2016-09-13 23:50:19 +01:00
committed by GitHub
parent 322ec1316a
commit 4e66c0fcd3

View File

@@ -419,7 +419,10 @@ class Style(object):
style = 'color' if cls._term_supports_color() else 'mono'
if len(content) > 1:
raise ValueError('cannot specify more than one content element')
content = content.pop()
try:
content = content.pop()
except KeyError:
content = 'full'
return cls(style == 'color'), content
def __call__(self, format_spec):