[Tutor] R: Re: Re: Re: Class learning

Mark Lawrence breamoreboy at yahoo.co.uk
Sat Jan 24 16:03:10 CET 2015

On 24/01/2015 01:50, Cameron Simpson wrote:
> My intuition is that a function is costly (potentially) and that
> consulting an attribute is very cheap.  I don't want to break such
> intuition.

It's not just your intuition, it's a fact.  Function calls are costly, 
relative to attribute lookup that is, at least in cPython.  I've no idea 
what the impact is in other implementations.  I'd guess that 99% of the 
time 99% of Python programmers needn't worry about it.

My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

More information about the Tutor mailing list