Re: [Pythonsound-devel] omde.score patch [was (no subject)]
Status: Beta
Brought to you by:
mupuxeddu
|
From: Maurizio U. P. <um...@ti...> - 2001-10-09 18:03:35
|
On Tue, 9 Oct 2001, Paul Winkler wrote: > If you like. But why is it necessary for the programmer to remember > that this method "has to do some work"? He/she is only interested in > the return value. If you know that a call is potentially going to consume much time, you can think of caching the values instead of calling it twice. Nothing more. Probably the best way should be caching onset min, onset max and end max values instead of caching onset and duration, isn't it? I think I'll do this. > > > BUG FIXED: calculate_onset_min_max always returned None as minimum. > > > > > > BUG FIXED: calculate_begin_end always returned None as the start. > > > > Did you checked it? > > min(None, everything) is always everything. It's like None is infinite and > > this is the reason to use max2(). > > $ python > Python 2.1 (#5, Oct 8 2001, 00:32:31) > [GCC 2.96 20000731 (Red Hat Linux 7.0)] on linux2 > Type "copyright", "credits" or "license" for more information. > >>> min (None, 1) > >>> print min (None, 1) > None Python 2.0 (#2, May 22 2001, 11:42:51) [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on linux2 Type "copyright", "credits" or "license" for more information. >>> min(None, 1) 1 >>> Ok. I defined min2 in omde.utility. Should be fixed in the CVS. Maurizio Umberto Puxeddu. |