Better HN
topnewbestaskshowjobs
Log inSign up

SethMLarson

1,019 karma · joined Jun 19, 2017 (9y ago) · 170 submissions

Security Developer-in-Residence at the Python Software Foundation, PSF Fellow, Minnesoootan, he/him

https://sethmlarson.dev

Submissions

comment 4y ago · link · parent

Thanks for the kind comment :)

152.

How UTF-8 Works(sethmlarson.dev ↗)

359 points · by SethMLarson · 4y ago · 190 comments

comment 4y ago · link · parent

I'd recommend dataclasses over namedtuples. In almost every case the "iterability" of a namedtuple ends up not being necessary (and can be a footgun!) what you really want is a lightweight namespace with types i.e. dataclasses!

comment 4y ago · link · parent

For more complicated cases I would agree, having a class that encapsulates logic that's inter-dependent is good. However I'd caution against reaching for the class approach for scenarios that can be captured by a function call. Python programmers love functions ;)

comment 4y ago · link · parent

Yep, using positional-only parameters makes calling the API tougher when all you've got is a `**kwargs` dictionary. But I think that for well designed APIs you'll be able to avoid the scenario of "having" to pass down arguments this way.

I have an article in the earlier stages about what I call the "keyword arguments blender" and how to avoid it, I think it's a common anti-pattern in lots of Python code (including my own, guilty!)

156.

The problem with Flask async views and async globals(sethmlarson.dev ↗)

1 points · by SethMLarson · 5y ago · discuss

157.

Designing Libraries for Async and Sync I/O(sethmlarson.dev ↗)

2 points · by SethMLarson · 6y ago · discuss

158.

Why URLs Are Hard: Path Parameters and Urlparse(sethmlarson.dev ↗)

2 points · by SethMLarson · 6y ago · discuss

159.

Review of 2019 for Urllib3 – Python's Most Downloaded Package(sethmlarson.dev ↗)

2 points · by SethMLarson · 6y ago · discuss

160.

Urllib3 Python 3 downloads exceed Python 2 for first time(twitter.com ↗)

2 points · by SethMLarson · 6y ago · discuss

161.

Optimize Web Apps with HTTP/2 Header Compression(sethmlarson.dev ↗)

1 points · by SethMLarson · 7y ago · discuss

162.

Designing for Real-World HTTPS(sethmlarson.dev ↗)

1 points · by SethMLarson · 7y ago · discuss

163.

Linting as Lightweight Defect Detection for Python(dev.to ↗)

1 points · by SethMLarson · 9y ago · discuss

123456