Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I found that example to be humerous, but specifically compared to the goals:

> Provide as few ways as possible—preferably one—of representing something.

Very Pythonic. Especially since representing a dict already has 2 ways, on the first page!



> Especially since representing a dict already has 2 ways,

And lists.

> Pythonic

Pythonic in the way that Python's 'There should be one...' is expressed through the existence of tuples, named tuples, dataclasses, regular classes and attrs (not part of the standard library but it seems to be as much of a goto as requests is)? ;)


You forgot to split out collections.namedtuple and typing.NamedTuple.

I love Python to death, but will readily admit that in no way is there “one obvious way” to do things.


Also see string concatenation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: