![](/static/253f0d9b/assets/icons/icon-96x96.png)
![](https://lemmy.ml/pictrs/image/q98XK4sKtw.png)
6·
10 months agoGet pissed at NVIDIA. They’re the problem.
Get pissed at NVIDIA. They’re the problem.
Thanks! That’s the sort of thing I’m looking for
Are there any good services like bandcamp, but for video? Even if it doesn’t have blockbuster/popular movies I’d be interested. I spend a lot of money on bandcamp because it’s easy and simple: I give them money and in return get bits that I do what I want with.
If you’re writing code that generic, why wouldn’t you want
str
to be passed in? For example,Counter('hello')
is perfectly valid and useful. OTOH,average_length('hello')
would always be1
and not be useful. OTOOH, maybe there’s a valid reason for someone to do that. If I’ve got a list of items of various types and want to find the highest average length, I’d want to domax(map(average_length, items))
and not have that blow up just because there’s a string in there that I know will have an average length of1
.So this all depends on the specifics of the function you’re writing at the time. If you’re really sure that someone shouldn’t be passing in a
str
, I’d probably raise aValueError
or a warning, but only if you’re really sure. For the most part, I’d just use appropriate type hints and embrace the phrase “we’re all consenting adults here”.