Comment

Comment by euphemize

Maybe it's just me, but I find:

  d = {}
  for k, v in request.items():
      try:
          d[k] = int(v)
      except (TypeError, ValueError):
          d[k] = None

much easier to read and understand than:

  walk_values(silent(int), request)

I need to find our what the "silent" attribute does and I'm not sure what type of errors are caught here. Although I'm all for hiding implementation when it's useful, I find it counter-intuitive to do it at this level in python, it makes things harder to read.
parent euphemize 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton