Hacker Newsnew | past | comments | ask | show | jobs | submit | geekone's commentslogin

Looks like according to the PEP it may eventually be default in 4-6 releases down the road: https://peps.python.org/pep-0703/#python-build-modes


Yeah that's pretty much how I've observed this happening, though I've found this scenario to be so much more common in teams that are overloaded with competing priorities they have no control of because of (usually) poor and/or naive management. To the point where even at 5-8 occurrences you kick the proverbial can down the road to focus on the "important" work items.


What was used to generate the diagrams in the post?


This is so useful! Would you consider adding some way of linking a filter to the ffmpeg documentation/reference for it? Or maybe some way of embedding it on a sidebar when a node is selected?


"Given that it may take up to several weeks to restore system availability,"

that's a huge hit to end of year payroll operations for many companies



Lambda expressions in python are limited to a single expression. The poster explicitly calls out wanting more than one line.


I don't understand why you wouldn't just define a function if you needed multi lines.


I don't understand why you wouldn't just define a function if you needed multi lines.

For the same reason that you wouldn’t necessarily define a function every time you wanted more than one line in the body of an if statement or for loop.

In a functional programming style, typically most of your control structures are represented as higher-order functions and you pass them other functions where you might use nested blocks of statements in an imperative style.

That is, where imperative pseudocode might look like this:

    for n in [0..10]:
        output_array[n] = n * n
some corresponding functional pseudocode might look more like this:

    output_array = for_each [0..10] (n -> n * n)
In some functional languages, it’s even idiomatic to write the supporting function so it reads more like this (borrowing Haskell’s $ notation, which avoids the awkward parentheses):

    output_array = for_each [0..10] $ \n ->
        n * n
Now you might want a multiline body for the supporting function in much the same situations that you might want a multiline body for the imperative for loop:

    for n in [0..10]:
        location = get_location(n)
        route = fastest_route_to(location)
        times[n] = average_journey_time(route)

    times = for_each [0..10] $ \n ->
        location = get_location(n)
        route = fastest_route_to(location)
        average_journey_time(route)
Similarly, if the logic you’re using in the inner part of the code is a self-contained concept, you might want to factor it out into a named function of its own in either case.

This functional style can be tidy and very flexible in languages that are designed to support it. However, I wouldn’t necessarily encourage it in a language like Python, precisely because Python’s syntax and language features don’t make it natural and concise to write like this.


It's possible to execute statements in a lambda through exec. But it's more of hack than what it worth.

  print((lambda x: [exec('x = x + 1; result = x'), eval('result')][1])(1))


I don't think the inaccurate title has much to do with the added color that the tweet could be a lie


why is there no expires field on https://securitytxt.org/.well-known/security.txt


Are you implying Floyd was resisting while he was being suffocated for 10 minutes?


No. Also, among other things you might in bad faith argue that I imply – but I do not – is that even if that was the case, killing him would've been OK.

What I actually implied was that I hardly think these two are very good examples of “average” persons, or “average” black persons, which should be taken into consideration in parent's logic.


> Are you implying Floyd was resisting while he was being suffocated for 10 minutes?

Especially the 2 minutes after another officer checked for and could not find a pulse.


Do you have suggestions on how to get real with this?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: