Linked by Thom Holwerda on Thu 9th Oct 2008 21:04 UTC, submitted by ganges master
General Development Python 2.6 has been released on October 1st. The major theme of this release is preparing the migration path to Python 3.0, a major redesign of the language. Whenever possible, Python 2.6 incorporates new features and syntax from 3.0 while remaining compatible with existing code by not removing older features or syntax. See the what's new docs for more details.
Thread beginning with comment 333064
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE: Yeah, greate
by Clinton on Fri 10th Oct 2008 01:37 UTC in reply to "Yeah, greate"
Clinton
Member since:
2005-07-05

I thought that would bug me when I first started using Python back in the 1.x days, and it did. However, it really stops being an issue after just a short while.

While I'm a die-hard fan of parenthesis and curly braces, I think Python's syntax forces good code formatting and makes your code very easy to read. Also, when a problem comes my way, the first language I reach for to solve it is Python, so I think the Python team must be doing something right; at least from my point of view.

Reply Parent Bookmark Score: 2

RE[2]: Yeah, greate
by RandomGuy on Fri 10th Oct 2008 02:14 in reply to "RE: Yeah, greate"
RandomGuy Member since:
2006-07-30

Seconded. Plus, there's a tool for those who want to program in python and still use curly brackets, IIRC.
The main difficulties caused by the significant indentation thing are:

a) Immediate yuck-reaction from former C programmers and those scarred by non-free-form FORTRAN.

b) Copying and pasting from forums gets harder. Whether or not this is bad is up to debate.

c) Mixing of tabs and spaces, especially in projects with more than one developer. If you can't get a bunch of people to follow the same coding style OR use a tool that changes the code accordingly, Python is probably the least of your problems, as in case b).

I've only used Python recently because it's just so much easier to remember/relearn than e.g. C++, especially if you just program in your spare time, for fun.

Reply Parent Bookmark Score: 3

RE[2]: Yeah, greate
by unavowed on Fri 10th Oct 2008 08:59 in reply to "RE: Yeah, greate"
unavowed Member since:
2006-03-23

Except that if you want to keep your code width limited to, say, 80 columns, then in many cases you are forced to use backslashes at the end of a line to inform python that you intend to continue it in the next. I personally prefer braces or "end" keywords over having to do this manual dance, which sometimes makes me feel I'm writing for the C preprocessor.

Example:
$ cd /usr/share/blender/scripts && grep '\\$' *.py | wc -l
938

Edited 2008-10-10 09:02 UTC

Reply Parent Bookmark Score: 2

RE[3]: Yeah, greate
by CrLf on Fri 10th Oct 2008 18:44 in reply to "RE[2]: Yeah, greate"
CrLf Member since:
2006-01-03

Limiting code to 80 columns in this day and age is just ridiculous. There's nobody out there still programming at the console (an 80x25 console at least), and everybody else just uses more than 80 columns with no problems.

You may say long lines make code more difficult to read, but if you limit yourself to lines with at most 80 characters (excluding leading whitespace), you won't that that big of a need to break statements into multiple lines.

But forgetting that, most statements that can become longish can also be broken in multiple lines without backslashes (argument lists, conditional statements, ...). Every statement that requires something more can have that something more on another line without using backslashes.

Actually right now I can't see anything that can't be broken, other than strings... (eg: print "some" \ "string")

Reply Parent Bookmark Score: 3