6 ms·
All these subtleties and gotchas signify, to me, a shit implementation and a fragmented interface. The exact opposite of the Zen of python.
by dilandau 6y ago
All these subtleties and gotchas signify, to me, a shit implementation and a fragmented interface. The exact opposite of the Zen of python.
- hedora 6y agoCan you give a practical example of a library or python subsystem that lives up to the “Zen of python” you are referring to?
- deleted 6y ago[deleted]
- j88439h84 6y agoThere are lots. `requests` is the most famous.
- uranusjr 6y agorequests is “clean enough” if you only use the highest level functionalities like making stateless requests and read out the response. I wouldn’t say it fits the description once you go past that. Zen of Python is an illusion. Complex things are complex, there’s simply no way to have an interface that’s always clean, useful, and maintainable.
- j88439h84 6y agoThese are about priorities, not about achieving perfection. It is easy to distinguish different pieces of software on these dimensions. For example: "Beautiful is better than ugly." Requests is more beautiful than urllib2. "Simple is better than complex." Trio is simpler than asyncio. "Readability counts." Python is more readable than C++. "There should be one-- and preferably only one --obvious way to do it." ''.join(strings), not sum(strings, ''). Note what isn't in the Zen of Python: performance, close-to-the-metal-ness, correctness, portability. Python often fails to live up to its values, but that doesn't make them meaningless.
- darksaints 6y agoWhat would be the essence of that zen? A ridiculously slow interpreter? Littering your directories with .pyc files? The world's worst package and dependency management? Don't get me wrong, python is a lovely language when the universe aligns perfectly. But buggy libraries with fragmented interfaces are everywhere in the python community, and any zen that could have been had by pythons expressiveness gets obliterated by the various other warts and faults of the ecosystem. It's just a tool, not a form of enlightenment.
- j88439h84 6y agoThere is a document called "the zen of python".
- true_religion 6y agoZen merely means meditation. It’s a practice, not a state of being or enlightenment. I think the confusion comes about because many people use Tao and zen interchangeably. The Tao is supposed to represent a total understanding of the underlying universal principals, which can be seen as a form of enlightenment. However Zen is not that. The zen of python would represent a way to meditate while coding in python. Though I will admit the actual document reads more like a Tao, and it was originally called “the way of Python” (Tao also translates as the way). https://www.python.org/dev/peps/pep-0020/ https://www.python.org/dev/peps/pep-0020/
- hynek 6y agoA more charitable view is that they signify an API that evolved from callback-based APIs like Twisted over many years and made nicer APIs like curio or trio only possible (whose features/insights slowly feed back into asyncio but backward compat keeps the warts around).
- nall10 6y agoEvolved? Twisted has a spectacular API, the only thing that is lacking is documentation. But even without docs I understood it faster than asyncio and it is more pleasant to use. Twisted is very elegant, but somehow elegant things get eradicated in the Python world. Time and again.
- ghostwriter 6y agoWhat's the added value of curio and trio APIs, compared to gevent's Queues, Pools, and Groups? https://sdiehl.github.io/gevent-tutorial/#data-structures https://sdiehl.github.io/gevent-tutorial/#data-structures
- hynek 6y agohttps://glyph.twistedmatrix.com/2014/02/unyielding.html https://glyph.twistedmatrix.com/2014/02/unyielding.html