Article View: comp.lang.c
Article #2030Re: variadic min and max, (any some and none, cat and more)
From: Lawrence D’Oliveiro
Date: Mon, 30 Nov 2026 18:49
Date: Mon, 30 Nov 2026 18:49
23 lines
1963 bytes
1963 bytes
On Mon, 30 Nov 2026 19:44:50 +0100, Bonita Montero wrote:
> Am 30.11.2026 um 19:40 schrieb Lawrence D’Oliveiro:
>>
>> Python 3.14.10 (main, Oct 26 2026, 15:12:11) [GCC 16.2.0] on linux
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> max(2, 3, 5)
>> 5
>> >>> args = [2, 3, 5]
>> >>> max(*args)
>> 5
>
> It's for sure more flexible since it can handle more variations of
> compatible types and it's for sure much fasger.
You betcha:
>>> max("red", "green", "blue")
'red'
>>> max(["red"], ["red", "green"], ["blue"])
['red', 'green']
Anything that has an ordering defined will work.
Technical Details
Message-ID:
<11ekgf8$mq5n$8@dont-email.me>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11bes8b$1gncr$1@dont-email.me> <11ek7b2$j8f6$1@raubtier-asyl.eternal-september.org> <11ekfu0$mq5n$4@dont-email.me> <11ekg71$n5p7$1@raubtier-asyl.eternal-september.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Lawrence D’Oliveiro <ldo@nz.invalid> Newsgroups: comp.lang.c Subject: Re: variadic min and max, (any some and none, cat and more) Date: Mon, 30 Nov 2026 18:49:12 -0000 (UTC) Organization: A noiseless patient Spider Lines: 23 Message-ID: <11ekgf8$mq5n$8@dont-email.me> References: <11bes8b$1gncr$1@dont-email.me> <11ek7b2$j8f6$1@raubtier-asyl.eternal-september.org> <11ekfu0$mq5n$4@dont-email.me> <11ekg71$n5p7$1@raubtier-asyl.eternal-september.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 30 Nov 2026 18:49:13 +0000 (UTC) Injection-Info: dont-email.me; logging-data="747703"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NVmfLRkJ3+SIN82ZZCSJZ"; posting-host="a13339aa161941cd02c77e7c540602f1" User-Agent: Pan/0.165 (Kostiantynivka) Cancel-Lock: sha1:3i/kLOgvkby29Gk2ntMTFdCBkp0= sha256:t+PluRc3mFhU/iePsq25/YVJNY4uSHd6X1k4Pmf3h3A= sha1:q7snAtwyMh+lKf8NVlt5solaQXE= sha256:0AQFHdk+nfEXntzn1yVTjvh4jJV+wcYwbLw9Bi1HFL0=