[Python-ideas] Consider adding clip or clamp function to math

David Mertz mertz at gnosis.cx
Tue Aug 9 19:24:55 EDT 2016


FWIW. I first opined that people should just write their own utility
function. However, there are enough differences of opinion about the right
semantics that I support it being in the standard library now.

Those decisions may or may not be made the way I most prefer, but I think
an "official behavior in the edge cases is best to have... I can always
implement my own version with different behavior if I need to.

On Aug 9, 2016 3:43 PM, "Chris Barker" <chris.barker at noaa.gov> wrote:

> Is this idea still alive?
>
> Despite the bike shedding, I think that some level of consensus may have
> been reached. So I suggest that either Neil (because it was your idea) or
> Steven (because you've had a lot of opinions, and done a lot of the
> homework) or both, of course, put together a reference implementation and a
> proposal, post it here, and see how it flies.
>
> It's one function, so hopefully won't need a PEP, but if your proposal
> meets with a lot of resistance, then you could turn it into a PEP then. But
> getting all this discussion summaries would be good as a first step.
>
> NOTE: I think it's a fine idea, but I've got way to omay other things I'd
> like to do first -- so I'm not going to push this forward...
>
> -CHB
>
>
>
>
> On Fri, Aug 5, 2016 at 10:24 PM, Stephen J. Turnbull <
> turnbull.stephen.fw at u.tsukuba.ac.jp> wrote:
>
>> Steven D'Aprano writes:
>>  > On Fri, Aug 05, 2016 at 11:30:35PM +0900, Stephen J. Turnbull wrote:
>>  >
>>  > > I can even think of a case where clamp could be used with a constant
>>  > > control and a varying bound: S-s inventory control facing occasional
>>  > > large orders in an otherwise continuous, stationary demand process.
>>  >
>>  > Sounds interesting. Is there a link to somewhere I could learn more
>>  > about this?
>>
>> The textbook I use is Nancy Stokey, The Economics of Inaction
>> https://www.amazon.co.jp/s/ref=nb_sb_noss?__mk_ja_JP=%E3%82%
>> AB%E3%82%BF%E3%82%AB%E3%83%8A&url=search-alias%3Daps&field-
>> keywords=nancy+stokey+economics+inaction
>>
>> The example I gave is not a textbook example, but is an "obvious"
>> extension of the simplest textbook models.
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> https://mail.python.org/mailman/listinfo/python-ideas
>> Code of Conduct: http://python.org/psf/codeofconduct/
>>
>
>
>
> --
>
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R            (206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115       (206) 526-6317   main reception
>
> Chris.Barker at noaa.gov
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160809/b6f5248e/attachment.html>


More information about the Python-ideas mailing list