Re: Assigning to None (was Re: Question about Python)



On Fri, 01 Jul 2005 12:59:20 -0400, François Pinard wrote:

> [Peter Hansen]
>> Mike Meyer wrote:
>> > Yes. I once grabbed an old program that did assignments to None. But
>> > that's always been a bad idea.
>
>> What was the use case!?
>
> People used to assign None to itself as a keyword argument in function
> headers. The goal was to make a local copy of the reference, which was
> then accessed faster than the global thing.

Can you say "premature optimization is the root of all evil"?

I'd like to see the profiling that demonstrated that this made a
significant -- or even measurable -- speed-up in anything but the most
unusual cases.


--
Steven

.



Relevant Pages

  • Re: Assigning to None
    ... >> Mike Meyer wrote: ... I once grabbed an old program that did assignments to None. ... Michael. ... Prev by Date: ...
    (comp.lang.python)
  • Re: Assigning to None
    ... > Mike Meyer wrote: ... I once grabbed an old program that did assignments to None. ... Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. ... Prev by Date: ...
    (comp.lang.python)