Method Chaining

Ned Batchelder ned at nedbatchelder.com
Fri Jun 17 20:02:30 EDT 2016


On Friday, June 17, 2016 at 6:23:12 PM UTC-4, Lawrence D’Oliveiro wrote:
> On Friday, June 17, 2016 at 8:13:50 PM UTC+12, Ned Batchelder wrote:
> 
> > But the unchained version is more explicit, and avoids
> > the awkward parenthesis.
> 
> You think of parentheses as “awkward”? Because elsewhere I see people recommending you put them in even if you don’t need them, for “clarity”.

Parentheses are used for a number of different purposes. It won't be
possible to make a sweeping statement about them everywhere.

I use "extra" parentheses to make operator application order clearer
where it isn't obvious to me, for example.

--Ned.



More information about the Python-list mailing list