Abdulla Al Kathiri wrote:
> Oh I forgot what if you want to return a set from your lambda? Maybe a lambda
> set should at least have one assignment statement to qualify it as one.
> Expressions only inside a set syntax will be just a normal set that doesn’t
> care about order as you pointed out.
Greetings list,
Just a funny Reddit quote:
(.NET 5 minimal APIs are even easier, and I swear .NET starts
to feel more like Python to me all the time, especially since
they removed the need for a Main method).
https://www.reddit.com/r/flask/comments/q0u6ci/scaling_flask_apis_for_highthrougput_sc
Le dim. 3 oct. 2021 à 16:21, a écrit :
> Date: Mon, 4 Oct 2021 01:03:34 +1100
> From: Steven D'Aprano
> Subject: [Python-ideas] Re: Feature request enumerate_with_rest or
> enumerate with skip or filter callback
> To: [email protected]
> Message-ID: <[email protected]
Le dim. 3 oct. 2021 à 16:21, a écrit :
> Date: Mon, 4 Oct 2021 01:03:34 +1100
> From: Steven D'Aprano
> Subject: [Python-ideas] Re: Feature request enumerate_with_rest or
> enumerate with skip or filter callback
> To: [email protected]
> Message-ID: <[email protected]
On Tue, Oct 5, 2021 at 9:02 AM Caleb Donovick wrote:
>
> > I wonder, could this be simplified a bit, on the assumption that a
> > well-written assertion shouldn't have a problem with being executed
> > twice?
>
> While I agree as an engineering principle an assert should not have side
> effects
>
> I wonder, could this be simplified a bit, on the assumption that a
> well-written assertion shouldn't have a problem with being executed
> twice?
While I agree as an engineering principle an assert should not have side
effects
and hence re-evaluation should be fine in most cases, it is not unive
> 2) Some OTHER exception occurs on the reevaluation. It's a chained
> exception like any other.
Except it's not a chained exception and displaying as such would be VERY
confusing IMO.
Granted we could easily strip the chained exception and just return the
original one. So after
reconsideration
On Tue, Oct 5, 2021 at 9:50 AM Caleb Donovick wrote:
>
> > 2) Some OTHER exception occurs on the reevaluation. It's a chained
> > exception like any other.
>
> Except it's not a chained exception and displaying as such would be VERY
> confusing IMO.
> Granted we could easily strip the chained ex
Have folks thought about allowing indexing dictionary views as in the
following code, where d is a dict object?
d.keys()[0]
d.keys()[-1]
d.values()[0]
d.values()[-1]
d.items()[0]
d.items()[-1] # item that would be returned by d.popitem()
I could see value to the last form in particular: you mi
On Tue, Oct 5, 2021 at 9:46 AM Erik Demaine wrote:
> Of course, the universal way to get the
> first item from an iterable x is
>
> item = next(iter(x))
>
> I can't say this is particularly readable, but it is functional and fast.
I think we can add `itertools.first()` for this idiom, and
`iterto
On Mon, Oct 4, 2021 at 5:46 PM Erik Demaine wrote:
> Have folks thought about allowing indexing dictionary views as in the
> following code, where d is a dict object?
>
> d.keys()[0]
> d.keys()[-1]
> d.values()[0]
> d.values()[-1]
> d.items()[0]
> d.items()[-1] # item that would be returned by d
On Sun, Oct 3, 2021 at 8:00 AM Jonathan Crall wrote:
> One of the motivations of this proposal is to incentivize writing code in
> a local scope, rather than a global one.
>
I'm not sure that's something to be incentivised necessarily ;-)
Yes, incentivising good code structure is a good thing,
12 matches
Mail list logo