Chris Angelico writes:
> What Python needs is not a way to cram more onto one line. What Python
> needs is a way to express an abstract concept: "iterate over the
> interesting parts of this collection".
Python has one, and you've already mentioned it:
for thing in (x for x in this_collec
On Sat, 5 Mar 2022 at 22:22, Stephen J. Turnbull
wrote:
>
> Chris Angelico writes:
>
> > What Python needs is not a way to cram more onto one line. What Python
> > needs is a way to express an abstract concept: "iterate over the
> > interesting parts of this collection".
>
> Python has one, and
On Sat, 5 Mar 2022 at 12:12, Chris Angelico wrote:
>
> On Sat, 5 Mar 2022 at 22:22, Stephen J. Turnbull
> wrote:
>
> > Python has one, and you've already mentioned it:
> >
> > for thing in (x for x in this_collection if is_interesting(x)):
> >
> > It's noticably verbose, but it's an exact tra
On Sat, 5 Mar 2022 at 23:32, Paul Moore wrote:
>
> On Sat, 5 Mar 2022 at 12:12, Chris Angelico wrote:
> >
> > On Sat, 5 Mar 2022 at 22:22, Stephen J. Turnbull
> > wrote:
> >
> > > Python has one, and you've already mentioned it:
> > >
> > > for thing in (x for x in this_collection if is_inte
Chris Angelico writes:
> What Python needs is a non-clunky way to express [filtered iteration].
I don't. In my own code there aren't any else-less cases of for: if:.
All the filtered iterations have intervening code at the top of the
loop before the if. Most could be refactored to use filtered
The faulthandler module is invaluable for tracking down segfaults in native
code, however it is really lacking the ability to add some kind of useful
breadcumb to aide debugging. Imagine you are running a large-scale distributed
job over tens of millions of images and a single one causes opencv
On Sat, 5 Mar 2022 at 12:43, Chris Angelico wrote:
>
> The throwaway function is a *terrible* idea for a lot of situations,
> because it puts the condition completely out-of-line. You have to go
> dig elsewhere to find out the meaning of the filter. A lambda function
> can work, but is about as cl
> On 2 Mar 2022, at 14:22, [email protected] wrote:
>
> The faulthandler module is invaluable for tracking down segfaults in native
> code, however it is really lacking the ability to add some kind of useful
> breadcumb to aide debugging. Imagine you are running a large-scale
> distributed job
On Sat, Mar 5, 2022 at 4:33 AM Paul Moore wrote:
> for thing in filter(is_interesting, this_collection):
> ...
>
> That seems pretty non-clunky. Is the issue here that "filter" is not
> sufficiently well-known? Or that you don't want to name the
> is_interesting function, and lambdas are "too
> Until you have this have you considered turning on core dumps? Then you will
> be able to see the image id in the dump file.
Alternatively you could write the context to a file. Then log the contents of
the file in a wrapper script that handlers python exiting on SEGV.
> I understand what you
10 matches
Mail list logo