Ask HN: What's the most beautiful code written in Python you have ever seen? - pedrodelfino
======
git-pull
SQLAlchemy:

[https://github.com/zzzeek/sqlalchemy](https://github.com/zzzeek/sqlalchemy)

[http://docs.sqlalchemy.org/en/latest/](http://docs.sqlalchemy.org/en/latest/)

[https://www.youtube.com/watch?v=vunIDi9Z-_8](https://www.youtube.com/watch?v=vunIDi9Z-_8)
( _Introduction to SQLAlchemy_ , 2014, 2:52:50)

[http://www.aosabook.org/en/sqlalchemy.html](http://www.aosabook.org/en/sqlalchemy.html)
(Overview in _The Architecture of Open Source Applications_ )

------
sharmi
This was back in 2005-2006. I was working with a guy who loves to code. His
favorite way to spend the weekend was to figure out ways to make our services
more robust and optimized. He had one major disadvantage.

His forgetfulness was legendary. He could barely remember what happened in the
morning or what code he wrote. He made this his strength by writing the
cleanest and well-structured code I have ever seen. So, not only him, but
anyone, without any prior knowledge, can jump into the code at any point in
time and immediately understand the flow and be productive. Obviously, it
helps that the code was in Python, but being in python by itself does not a
great code make.

------
navbaker
I once programmed a complete chess board in four lines of code:

>import chess

>import chess.svg

>board = chess.Board()

>board

I'm pretty sure I'm a genius.

------
RUG3Y
I've said this in other threads recently - The Flask source code is really
awesome and reading helped me learn Python better.

------
tcbawo
I've enjoyed reading a lot of Peter Norvig's python code. There is his Lisp
implemention ([http://norvig.com/lispy.html](http://norvig.com/lispy.html)).
He also created a spell checker that was an informative and interesting read.

------
svisser
Earlier thread:
[https://news.ycombinator.com/item?id=9896369](https://news.ycombinator.com/item?id=9896369)

------
teapot01
Go to python repl

> import this

