RE: Tuple Comprehension ???

2023-02-21 Thread avi.e.gross
atch allowed configurations. Many languages have such needs and some of them do things differently. As an example, a language like R allows you to say do.call(func, list) which goes and calls func() with the expanded arguments taken from the list. Different idea for a related goal. Good luck.

Re: Tuple Comprehension ???

2023-02-21 Thread Thomas Passin
On 2/21/2023 8:52 PM, Hen Hanna wrote: On Tuesday, February 21, 2023 at 10:39:54 AM UTC-8, Thomas Passin wrote: On 2/21/2023 12:32 PM, Axy via Python-list wrote: On 21/02/2023 04:13, Hen Hanna wrote: (A) print( max( * LisX )) (B) print( sum( * LisX ))

Re: Tuple Comprehension ???

2023-02-21 Thread Hen Hanna
On Tuesday, February 21, 2023 at 10:39:54 AM UTC-8, Thomas Passin wrote: > On 2/21/2023 12:32 PM, Axy via Python-list wrote: > > On 21/02/2023 04:13, Hen Hanna wrote: > >> > >> (A) print( max( * LisX )) > >> (B) print( sum( * LisX ))<--- Bad >

RE: Tuple Comprehension ???

2023-02-21 Thread avi.e.gross
that way, the design of max() and sum() may well make quite a bit more sense and also why they are not identically designed. -Original Message- From: Python-list On Behalf Of Axy via Python-list Sent: Tuesday, February 21, 2023 2:37 PM To: python-list@python.org Subject: Re: Tuple Com

Re: Tuple Comprehension ???

2023-02-21 Thread Axy via Python-list
On 21/02/2023 19:11, avi.e.gr...@gmail.com wrote: In your own code, you may want to either design your own functions, or use them as documented or perhaps create your own wrapper functions that carefully examine what you ask them to do and re-arrange as needed to call the function(s) you want

Re: Tuple Comprehension ???

2023-02-21 Thread Hen Hanna
On Tuesday, February 21, 2023 at 9:33:29 AM UTC-8, Axy wrote: > On 21/02/2023 04:13, Hen Hanna wrote: > > > > (A) print( max( * LisX )) > > (B) print( sum( * LisX )) <--- Bad syntax !!! > > > > What's most surprising is (A) is ok, and (B) is not. > > > > even tho' max() and sum()

RE: Tuple Comprehension ???

2023-02-21 Thread avi.e.gross
ython-list On Behalf Of Roel Schroeven Sent: Tuesday, February 21, 2023 1:11 PM To: python-list@python.org Subject: Re: Tuple Comprehension ??? Hen Hanna schreef op 21/02/2023 om 5:13: > (A) print( max( * LisX )) > (B) print( sum( * LisX ))<

Re: Tuple Comprehension ???

2023-02-21 Thread Thomas Passin
On 2/21/2023 12:32 PM, Axy via Python-list wrote: On 21/02/2023 04:13, Hen Hanna wrote: (A)   print( max( * LisX )) (B)   print( sum( * LisX ))    <--- Bad syntax !!! What's most surprising is (A)  is ok, and  (B) is not.     even

Re: Tuple Comprehension ???

2023-02-21 Thread Roel Schroeven
Hen Hanna schreef op 21/02/2023 om 5:13: (A) print( max( * LisX )) (B) print( sum( * LisX ))<--- Bad syntax !!! What's most surprising is (A) is ok, and (B) is not. even tho' max() and sum() have (basically) the same

RE: Tuple Comprehension ???

2023-02-21 Thread avi.e.gross
res making a generator first. -Original Message- From: Python-list On Behalf Of Hen Hanna Sent: Monday, February 20, 2023 11:14 PM To: python-list@python.org Subject: Re: Tuple Comprehension ??? On Monday, February 20, 2023 at 7:57:14 PM UTC-8, Michael Torrie wrote: > On 2/20/23 20:3

Re: Tuple Comprehension ???

2023-02-21 Thread Axy via Python-list
On 21/02/2023 04:13, Hen Hanna wrote: (A) print( max( * LisX )) (B) print( sum( * LisX ))<--- Bad syntax !!! What's most surprising is (A) is ok, and (B) is not. even tho' max() and sum() have (basically) the same

Re: Tuple Comprehension ???

2023-02-21 Thread Hen Hanna
On Monday, February 20, 2023 at 7:57:14 PM UTC-8, Michael Torrie wrote: > On 2/20/23 20:36, Hen Hanna wrote: > > For a while, i've been curious about a [Tuple Comprehension] > I've never heard of a "Tuple comprehension." No such thing exists as > far as I know. > > So finally i tried it, and the

Re: Tuple Comprehension ???

2023-02-21 Thread Cameron Simpson
On 20Feb2023 19:36, Hen Hanna wrote: For a while, i've been curious about a [Tuple Comprehension] So finally i tried it, and the result was a bit surprising... X= [ x for x in range(10) ] This is a list comprehension, resulting in a list as its result. X= ( x for x in range(10) )

RE: Tuple Comprehension ???

2023-02-20 Thread avi.e.gross
is to be immutable. There can be other benefits such as storage space used. And in many ways, tuples are supposed to be faster than lists. -Original Message- From: Python-list On Behalf Of Michael Torrie Sent: Monday, February 20, 2023 10:57 PM To: python-list@python.org Subject: Re: Tuple

Re: Tuple Comprehension ???

2023-02-20 Thread Michael Torrie
On 2/20/23 20:36, Hen Hanna wrote: > For a while, i've been curious about a [Tuple Comprehension] I've never heard of a "Tuple comprehension." No such thing exists as far as I know. > So finally i tried it, and the result was a bit surprising... > > > X= [ x for x in range(10) ] > X=