Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it a convention in Python documentation to include parentheses after function/method names?

Tags:

python

My experience in reading Python documentation is that when referring to a function/method one include parentheses after the name. For example,

 "... the function f() does ... " 

rather than

 "... the function f does ... " 

I think that's a good idea, and I generally follow that convention. But I can't find a statement of such a convention anywhere. Is there one, or am I making this up?

like image 684
RussAbbott Avatar asked Oct 20 '25 10:10

RussAbbott


1 Answers

() in Python means that the specific object is callable... I guess that's why they write f() instead of f to explicitly state that.

like image 129
Vibhu Upamanyu Avatar answered Oct 21 '25 23:10

Vibhu Upamanyu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!