8000 Copybara import of the project: · randomprin/python-fire@7d87eb2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d87eb2

Browse files
jaredtrogcopybara-github
authored andcommitted
Copybara import of the project:
-- 9061166 by Jared Trog <jared.trog@gmail.com>: Support printing classes with overridden str method as SimpleGroups google#197 COPYBARA_INTEGRATE_REVIEW=google#224 from jaredtrog:fix-issue-197 9061166 PiperOrigin-RevId: 297857231 Change-Id: Ibf2c344eda89f5a042726bde003bb4653ae3835e
1 parent a5dba13 commit 7d87eb2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fire/value_types.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ def IsCommand(component):
3737

3838

3939
def IsValue(component):
40-
return isinstance(component, VALUE_TYPES)
40+
return isinstance(component, VALUE_TYPES) or (
41+
hasattr(component, '__str__') and inspect.ismethod(component.__str__))
4142

4243

4344
def IsSimpleGroup(component):

0 commit comments

Comments
 (0)
0