Why Nostr? What is Njump?
2024-04-10 19:07:31
in reply to

scy on Nostr: Well yeah, a<min?min:a>max?max:a isn't exactly readable anyway, I'd say. In Python, ...

Well yeah,

a<min?min:a>max?max:a

isn't exactly readable anyway, I'd say.

In Python, I'd rather write something like

x = min if a < min else (max if a > max else a)

Do note that there are actual min and max functions that can do this, e.g.

x = max(min_val, min(max_val, a))
Author Public Key
npub15pc5vt5kqgr60g389gl4n5zzuktz8wezz76klym9ew3puy3p8clqckhvce