Readit News logoReadit News
jbmchuck commented on Crimes with Python's Pattern Matching (2022)   hillelwayne.com/post/pyth... · Posted by u/agluszak
vlade11115 · 6 days ago
While the article is very entertaining, I'm not a fan of the pattern matching in Python. I wish for some linter rule that can forbid the usage of pattern matching.
jbmchuck · 6 days ago
Should be easily doable with a semgrep rule, e.g.:

    ~> cat semgrep.yaml
    rules:
      - id: no-pattern-matching
        pattern: |
          match ...:
        message: |
          I'm not a fan of the pattern matching in Python
        severity: ERROR
        languages:
          - python
...

    ~> cat test.py
    #!/usr/bin/env python3

    foo = 1
    match foo:
      case 1:
        print("one")
...

    ~> semgrep --config semgrep.yaml test.py   


     no-pattern-matching
          I'm not a fan of the pattern matching in Python
                                                         
            4┆ match foo:
            5┆   case 1:
            6┆     print("one")
(exits non-0)

jbmchuck commented on California sent residents' personal health data to LinkedIn   themarkup.org/pixel-hunt/... · Posted by u/anticorporate
WalterBright · 3 months ago
There was no workers' revolt in the 19th century US, but the lives of the poor across the board pulled scores of millions in poverty into the middle class and beyond.

The common thread of workers' lives improving is free markets, not revolts.

jbmchuck · 3 months ago
There were quite a few slave revolts in the 19th century.
jbmchuck commented on US newspapers are deleting old crime stories, offering subjects a 'clean slate'   theguardian.com/us-news/2... · Posted by u/bookofjoe
FredPret · 8 months ago
There are private prisons in the US that benefit from more prisoners.

But there are many more people and organizations there that benefit from fewer prisoners.

For most purposes, a country is not a singular thing.

jbmchuck · 8 months ago
I suspect that is true but here is the difference: organizations that benefit from fewer prisons have a multitude of other things they benefit from (and can lobby for). Private prison operators on the other hand really only have one thing that can improve their bottom line at the end of the day - more prisons.

Outside of a few non-profit orgs I suspect there aren't a lot of dollars lobbying for fewer prisons, it's not a great look and it's easily to spin as "company X doesn't want to lock up violent criminals!

On the other hand that's really the only agenda item private prison operators put their lobbying dollars toward.

jbmchuck commented on The demise of the mildly dynamic website (2022)   devever.net/~hl/mildlydyn... · Posted by u/thunderbong
pram · a year ago
Lambda has its places, but I've noticed devs consistently using it for things where it doesn't make any goddamn sense. Like processing messages from a Kafka consumer, the function is running 24/7. People think it's a container or something.
jbmchuck commented on Diffractive Chocolate   wp.optics.arizona.edu/osc... · Posted by u/joebig
jjtheblunt · a year ago
what the heck are they talking about in the linked article? each color of light travels at a different speed?

> White light can be separated into all seven major colors of the complete spectrum or rainbow by using a diffraction grating. The grating separates light into colors as the light passes through the many fine slits of the grating. Each color travels at a different speed and therefore has a different angle of refraction when it hits the grating.

jbmchuck · a year ago
They travel c in vacuo but not through different media.

Dead Comment

u/jbmchuck

KarmaCake day20April 10, 2024View Original