Not auto-invoking when there are still dot notation parts to examine. The…

Not auto-invoking when there are still dot notation parts to examine. The previous behaviour breaks calls like foo.bar.baz, if foo.bar defines __call__
parent ca2cd4c0
......@@ -48,7 +48,10 @@ def _get_value(item, key):
# are considered objects by the test above.
if hasattr(item, key):
attr = getattr(item, key)
if _is_callable(attr):
# If there are still parts to process (in a dot-notation key),
# we do not automatically invoke the object, even if it's callable.
autocall = len(parts) > 1
if autocall and _is_callable(attr):
value = attr()
else:
value = attr
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment