Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
_nosewings_
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
_nosewings_
5y ago
It's also worth pointing out that, in a world where the Web is so pervasive, being honest (and, in particular, developing a reputation for being honest) has substantial advantages. Conspiracy theories and general suspicion spread extre
2.
▲
by
_nosewings_
5y ago
The mistrust runs in both directions (although the timbre is different). I believe that the CDC has had nothing but the best of intentions throughout the pandemic, but it's clear that they don't really trust US citizens enough to
3.
▲
by
_nosewings_
5y ago
R0 is indeed static. It's R(t), the reproduction rate at time t, that is not static.
4.
▲
by
_nosewings_
6y ago
> What object is the scope of a comprehension (in Py 3; in py 2 they don't have their own scope) a dict attached to? The generator object that gets created behind the scenes. > And, if you can answer that why could there not be s
5.
▲
by
_nosewings_
6y ago
In Python 3, list comprehensions use generators behind the scenes.
6.
▲
by
_nosewings_
6y ago
Not introducing a new scope with a match is unfortunate, but it's also consistent with how every other language feature interacts with scoping. > (As well as a method to “pin” variables from the containing scope to use them in match
7.
▲
by
_nosewings_
6y ago
The explanation is that (in Python 3) list comprehensions are really just syntactic sugar for generator expressions. In Python, "scope" is really a synonym for "dictionary attached to some object", so generators can have
8.
▲
by
_nosewings_
6y ago
If you really need to compare against a variable, use an "if". The primary benefit of pattern-matching is destructuring. EDIT: It looks like you actually can match against constants with this PEP, as long as you access your consta
9.
▲
by
_nosewings_
6y ago
That's just an inevitable consequence of the fact that, in Python, "scope" is synonymous with "dictionary attached to some object." This is already how for-loops work.
10.
▲
by
_nosewings_
6y ago
Yes, of course. Again, this is how it works in basically every mainstream language with this feature.
11.
▲
by
_nosewings_
6y ago
This is how pattern matching works in any language (except for some niche languages that allow nonlinear patterns, like Curry). Many of the comments here reveal a bizarre parochialism.
12.
▲
by
_nosewings_
6y ago
IMO, the Web could stand to be a little bit harder to use.
13.
▲
by
_nosewings_
6y ago
That's essentially the leading theory. They're called WIMPs.