@wasabi@feddit.de avatar

wasabi

@wasabi@feddit.de

This profile is from a federated server and may be incomplete. Browse more on the original instance.

wasabi,
@wasabi@feddit.de avatar

python -m http.server came in handy so many times!

wasabi,
@wasabi@feddit.de avatar

Lmao, chinese tea ceremony includes like 500 steps.

wasabi,
@wasabi@feddit.de avatar

Honestly the most complete source of high res music is private trackers like redacted. You can download all the stuff from qobuz and bandcamp, every CD rip you can think of in bit perfect quality of and even very good vinyl rips. You basically can download any version ever released from any album.

Generic Typing with `Iterable[str]` or `Collection[str]`: Should you use it?

I often find myself defining function args with list[SomeClass] type and think “do I really care that it’s a list? No, tuple or Generator is fine, too”. I then tend to use Iterable[SomeClass] or Collection[SomeClass]. But when it comes to str, I really don’t like that solution, because if you have this function:...

wasabi,
@wasabi@feddit.de avatar

🦆

wasabi,
@wasabi@feddit.de avatar

I know that Iterable and Collection aren’t the same. My point is, that if you use Iterable[str] or Collection[str] as a more flexible alternative to list[str] you no longer have any type-hinting support protecting against passing in a plain string and you could end up with a subtle bug by unexpectedly looping over [‘f’, ‘o’, ‘o’] instead of [‘foo’].

wasabi,
@wasabi@feddit.de avatar

But what if you actually don’t want str to be valid?

wasabi,
@wasabi@feddit.de avatar

str matches most of these contracts, though, requiring additional checks if a str was passed or one of these collections containing strings.

wasabi,
@wasabi@feddit.de avatar

This + an assert seems like the way to go. I think that str should never have fulfilled these contracts in the first place and should have a .chars property that returns a list of one-character-strings. But this change would break existing code, so it is not going to happen.

wasabi,
@wasabi@feddit.de avatar

Yes, you’re right. It also a lot of benefits.

wasabi,
@wasabi@feddit.de avatar

Maybe something like passing in a list of patterns which should match some data, or a list of files/urls to download would be examples of where I would like to be generic, but taking in a string would be bad.

But the real solution be to convert it to foo(*args: str). But maybe if you take 2 Container[str] as input so you can’t use *args. But no real world example comes to mind.

wasabi,
@wasabi@feddit.de avatar

Yes, that’s a good alternative for Collection[str] but not so much for Iterable[str] as you lose the lazyness of Generators.

wasabi,
@wasabi@feddit.de avatar

Firefox, Neovim, Tmux, Various KDE applications, Nextcloud, Wine, Signal, OpenSSH

Probably many more

wasabi,
@wasabi@feddit.de avatar

Seems like it is no longer maintained. Unfortunately that means it is only a matter of time until it breaks forever.

wasabi,
@wasabi@feddit.de avatar

For now. YouTube constantly changes stuff, requiring changes to newpipe. As no one will merge these into the fork, it will stop working when that happens.

What is your experience with Hetzner server auction?

I’m currently using a VPS from contabo and am curious if I would get better performance CPU and disk I/O wise because of the dedicated resources. The bigger VPS from contabo seem to be in a similar ballpark to the cheapest options available in the hetzner server auction when it comes to corecount, ram and disk size and price.

wasabi,
@wasabi@feddit.de avatar

Don’t do this. Running unpatched software is a recipe for disaster.

wasabi,
@wasabi@feddit.de avatar

It’s a rather standard feature. Hardware and software have to be built/configured right for it to work well. That’s what Valve did. I don’t think there is any special sauce involved software wise.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • bokunoheroacademia
  • rosin
  • thenastyranch
  • mdbf
  • slotface
  • Youngstown
  • khanakhh
  • kavyap
  • cubers
  • DreamBathrooms
  • rhentai
  • osvaldo12
  • ethstaker
  • magazineikmin
  • lostlight
  • normalnudes
  • InstantRegret
  • everett
  • Durango
  • tester
  • relationshipadvice
  • GTA5RPClips
  • tacticalgear
  • Leos
  • cisconetworking
  • HellsKitchen
  • modclub
  • sketchdaily
  • All magazines