Typing arguments in python

Alex Martelli aleax at aleax.it
Wed Apr 16 13:05:50 EDT 2003


Dale Strickland-Clark wrote:
   ...
>>def f(fileobj):
>>    write = fileobj.write
>>    write('')
>>    # rest of function follows -- just call write('...') when needed
> 
> Way too fussy and obscure for my liking. Also, the assert is debugging
> code and nicely goes away in production.

...while the bound-methods stay in local variables and accelerate operations
even "in production" -- oh woe!  No accounting for tastes, I guess;-)


Alex





More information about the Python-list mailing list