468,785 Members | 1,645 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,785 developers. It's quick & easy.

Beautiful Code in Python?

js
Hi,

Have you ever seen Beautiful Python code?
Zope? Django? Python standard lib? or else?

Please tell me what code you think it's stunning.
Mar 2 '08 #1
8 2532
On Mar 2, 5:23 pm, js <ebgs...@gmail.comwrote:
Hi,

Have you ever seen Beautiful Python code?
Zope? Django? Python standard lib? or else?

Please tell me what code you think it's stunning.
The doctest module in the standard library.

M.S.
Mar 2 '08 #2
On Mon, 3 Mar 2008 01:23:32 +0900, js <eb*****@gmail.comwrote:
>Hi,

Have you ever seen Beautiful Python code?
Zope? Django? Python standard lib? or else?

Please tell me what code you think it's stunning.
Just about any Python code I look at.
Mar 2 '08 #3
On Mar 2, 12:01*pm, John DeRosa <stug...@qwest.netwrote:
On Mon, 3 Mar 2008 01:23:32 +0900, js <ebgs...@gmail.comwrote:
Hi,
Have you ever seen Beautiful Python code?
Zope? Django? Python standard lib? or else?
Please tell me what code you think it's stunning.

Just about any Python code I look at.
Decorators, with, and namedtuple.
Mar 2 '08 #4
js a écrit :
Hi,

Have you ever seen Beautiful Python code?
Zope? Django? Python standard lib? or else?

Please tell me what code you think it's stunning.
FormEncode has some very interesting parts IMHO.
Mar 3 '08 #5
On Mar 2, 8:35*am, Michele Simionato <michele.simion...@gmail.com>
wrote:
On Mar 2, 5:23 pm, js <ebgs...@gmail.comwrote:
Hi,
Have you ever seen Beautiful Python code?
Zope? Django? Python standard lib? or else?
Please tell me what code you think it's stunning.

The doctest module in the standard library.

*M.S.
The first thing of beauty I found in Python (coming from C, C++, and
perl) was the way Python handled variables, or as someone recently
described them, names.

Python's "for" statement is always beautiful to look at. Especially
when someone uses the else clause rather than trying to detect if the
list was exhausted. I sometimes avoid using the comprehensions just to
get an excuse to write another for loop in Python. There can never be
enough for loops written in Python!

Also, Python's iterator interface is by far the most beautiful thing I
have ever seen in the world of programming. Of course, the reason why
the for loop is so beautiful is because iterators are so beautiful.
Mar 3 '08 #6
Please tell me what code you think it's stunning.

Pexpect is (almost) pseudocode is (almost) poetry to my ears. And
there's a lot of narrative in it as well:

http://pexpect.svn.sourceforge.net/v...e=text%2Fplain
Mar 3 '08 #7
On Mar 2, 1:18*pm, castiro...@gmail.com wrote:
On Mar 2, 12:01*pm, John DeRosa <stug...@qwest.netwrote:
On Mon, 3 Mar 2008 01:23:32 +0900, js <ebgs...@gmail.comwrote:
>Hi,
>Have you ever seen Beautiful Python code?
>Zope? Django? Python standard lib? or else?
>Please tell me what code you think it's stunning.
Just about any Python code I look at.

Decorators, with, and namedtuple.
<running gag>Oh yeah, and variable arguments and keyword
dictionaries.<throat clear/></running gag>
Mar 9 '08 #8
On Mar 9, 6:44*pm, castiro...@gmail.com wrote:
On Mar 2, 1:18*pm, castiro...@gmail.com wrote:
On Mar 2, 12:01*pm, John DeRosa <stug...@qwest.netwrote:
On Mon, 3 Mar 2008 01:23:32 +0900, js <ebgs...@gmail.comwrote:
Hi,
Have you ever seen Beautiful Python code?
Zope? Django? Python standard lib? or else?
Please tell me what code you think it's stunning.
Just about any Python code I look at.
Decorators, with, and namedtuple.

<running gag>Oh yeah, and variable arguments and keyword
dictionaries.<throat clear/></running gag>
If you're C++, garbage collection. How's the cycle detector? The
pages and pages get pretty specific.
Mar 21 '08 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

38 posts views Thread by vinjvinj | last post: by
8 posts views Thread by Gekitsuu | last post: by
1 post views Thread by Tempo | last post: by
reply views Thread by Anthra Norell | last post: by
3 posts views Thread by cjl | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
2 posts views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.