Re: Assigning to None (was Re: Question about Python)
- From: Steven D'Aprano <steve@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 03 Jul 2005 11:47:07 +1000
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
.
- Follow-Ups:
- Re: Assigning to None (was Re: Question about Python)
- From: Bengt Richter
- Re: Assigning to None (was Re: Question about Python)
- References:
- Question about Python
- From: Jan Danielsson
- Re: Question about Python
- From: Mike Meyer
- Assigning to None (was Re: Question about Python)
- From: Peter Hansen
- Re: Assigning to None (was Re: Question about Python)
- From: François Pinard
- Question about Python
- Prev by Date: Re: map/filter/reduce/lambda opinions and background unscientific mini-survey
- Next by Date: Re: Inheriting from object
- Previous by thread: Re: Assigning to None (was Re: Question about Python)
- Next by thread: Re: Assigning to None (was Re: Question about Python)
- Index(es):
Relevant Pages
|