wasabi

joined 2 years ago
[–] wasabi@feddit.de 1 points 2 years ago

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

[–] wasabi@feddit.de 3 points 2 years ago

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@feddit.de 3 points 2 years ago (3 children)

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

[–] wasabi@feddit.de 3 points 2 years ago* (last edited 2 years ago)

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@feddit.de 5 points 2 years ago* (last edited 2 years ago)

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

Probably many more

[–] wasabi@feddit.de 2 points 2 years ago (1 children)
[–] wasabi@feddit.de 2 points 2 years ago (1 children)

Die Synchronisierung ist nur manuell oder?

[–] wasabi@feddit.de 7 points 2 years ago (1 children)

Re- not reverse-engineer.

[–] wasabi@feddit.de 7 points 2 years ago (1 children)

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

[–] wasabi@feddit.de 5 points 2 years ago

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.

[–] wasabi@feddit.de 2 points 2 years ago (1 children)

Die Sonne ist KALT!

view more: ‹ prev next ›