How to write Inline Functions in Python?

Arivazhagan arivu at qmaxtest.com
Thu Nov 14 03:12:27 EST 2002


Thank you Tim Delaney for your quick response.
regards
b.arivazhagan

-----Original Message-----
From: Delaney, Timothy [mailto:tdelaney at avaya.com]
Sent: Thursday, November 14, 2002 11:51 AM
To: 'arivu at qmaxtest.com'; python-list at python.org
Subject: RE: How to write Inline Functions in Python?


> From: arivu at qmaxtest.com [mailto:arivu at qmaxtest.com]

> Can any one please explain how to write a Inline Function in Python?

No. See below.

> Is Inline Functions available in python?

No.

I assume you're coming from C++. In that case, I suggest you take a good
hard look at why you want to write inline functions/methods anyway. If
you're doing it for performance reasons, your compiler is almost certainly
going to be better at deciding what to inline, and has the option to do so
unless you explicitly tell it not to. If you're doing for any other reason
(such as putting code in header files) I strongly advise against it.

Inline was developed when computers were slower and compilers were more
stupid. These days I see no need to inline whatsoever.

Tim Delaney





More information about the Python-list mailing list