question about the id()
Bengt Richter
bokr at oz.net
Mon May 16 13:31:18 EDT 2005
On Mon, 16 May 2005 16:57:12 GMT, Andrew Dalke <dalke at dalkescientific.com> wrote:
>Peter Dembinski wrote:
>> So, the interpreter creates new 'point in address space' every time
>> there is object-dot-method invocation in program?
>
>Yes. That's why some code hand-optimizes inner loops by hoisting
>the bound objection creation, as
>
>data = []
>data_append = data.append
>for x in some_other_data:
> .... work with x to make y ....
> data_append(y)
>
Sorry about the me-too. I hadn't seen your post. I should know better ;-)
Regards,
Bengt Richter
More information about the Python-list
mailing list