No, It is Immpossible.
Attribute Reference Syntax
attributeref ::= primary "." identifier
Quoting documentation ,
An attribute reference is the primary element, followed by a period and name.
the name must be a regular Python identifier , and identifiers cannot contain special characters such as (.
However, you can use a simple conditional expression to select primary:
(foo().bar() if condition else foo()).baz()
It is equivalent
if condition:
primary = foo().bar()
else:
primary = foo()
primary.baz()
, , , .