469,592 Members | 1,753 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

realization: no assignments inside expressions


I've been doing a little c programming again (ouch!) and it's just hit
me
why python does not allow assignment inside expressions (as in c):
because it is absolutely essential that all assignments are as visible
as possible. In python the assignment is the declaration; when
declarations
are as cheap as this it's hard not to fall to the temptation to re-use
a
variable unknowingly. I am constantly scanning the line of assignments
to see what variables are already live, and I just realised how easy it
is
to do that. Up to now I guess I thought it was just a restriction to
stop new
users of python from writing too obfuscated code.

wow.

Simon.

May 18 '06 #1
0 832

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Jacek Generowicz | last post: by
3 posts views Thread by bearophileHUGS | last post: by
17 posts views Thread by Brian Blais | last post: by
3 posts views Thread by David | last post: by
3 posts views Thread by rajmohan.h | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.