News for hackers. Stuff that matters.
Re:Why Python? by silentbicycle on Saturday October 23, 2010 @08:27AM (#1823308)
My complaint mixed two things - one, I'm not convinced that decorators are a special-case "feature" that would come for free with better lambdas. Two, does Python need tuples, dicts, AND lists? (I know it's had them for a long time.)

Python seemed really refreshingly clean compared to Perl and C++, the languages I'd been using previously. I still think it's a decent language, but Python is to Perl and Lua is to Python along those lines. I've moved on.

I'm probably still just annoyed about Guido's position on tail-call optimization, though.

Re:Why Python? by viraptor on Saturday October 23, 2010 @10:13AM (#1823510)
> does Python need tuples, dicts, AND lists?

Pretty much yes. dicts are something completely separate from list-like types. Those should not be mixed.

lists and tuples depend on your preference really, but I appreciate them being available. There are many places where you want to pass an immutable sequence of objects and the list is just not right... Sure we could get rid of them, but what would be the gain there?

Re:Why Python? by techbio on Saturday October 23, 2010 @12:37PM (#1823828)
Generally I will use lists for fast and loose vectors, in unoptimized code, and tuples for more firmly "typed" data, or performance enhancements.

I don't need more and I don't need less: the two seem well-balanced for me.

As someone who abhorred Perl, Ruby looks a little frightening. Python looks and feels clean, especially for blocks of data.

In OO though, self.whatever appears more frequently than I'd like.

Re:Why Python? by vog on Saturday October 23, 2010 @09:30AM (#1823434)
> Two, does Python need tuples, dicts, AND lists?

While I agree that tuples and lists could be merged, I don't think that dicts should be merges with them, too.

When I first looked at PHP I found the concept of having a unified "array" type (for arrays and hash tables) very clever. However, I quickly changed my mind.

Now I think that the array/hash unification is one of the biggest design mistakes in PHP as it provides no benefit (both have completely different use cases), but causes a lot of trouble.

A similar argument goes for ECMA Script (aka JavaScript).

Re:Why Python? by silentbicycle on Saturday October 23, 2010 @09:35AM (#1823443)
It seems to work well for Lua, though it has an explicit optimization so that dicts with consecutive integer keys are automatically stored internally as an array.
Re:Why Python? by wyuenho on Saturday October 23, 2010 @09:11AM (#1823396)
Python's lambda is not broken, it's just that the notion of a (progn) from Lisp doesn't exist in Python, so Python's lambda is a lot harder to use because for anything more complicated then 1 expression, you'd have to define a fully named function somewhere. For the most part this isn't an issue because you probably wouldn't want to have more then 2 or 3 expressions in a lambda anyway.

Granted, a lot of languages like Ruby, Lua, ML and even CoffeeScript have arguably even cleaner syntax then Python, but none has as vast a community and quality libraries that mirror Python. In choosing a language, the language itself matters, but the ecosystem equally matters IMHO.

Re:Why Python? by vog on Saturday October 23, 2010 @09:24AM (#1823421)
> Granted, a lot of languages like Ruby, Lua, ML and even CoffeeScript have arguably even cleaner syntax then Python

But Python has still the cleanest standard API. At least for me, that's what made me switch from Ruby to Python in the past.

Re:Why Python? by silentbicycle on Saturday October 23, 2010 @09:39AM (#1823451)
They're also much cleaner in languages with expression-oriented rather than statement-oriented semantics -- languages where the result of a function is implicitly the last value in it, without needing a return statement.
Re:Why Python? by gaius on Saturday October 23, 2010 @11:03AM (#1823609)
But you can nest function definitions, so in practice the lack of a multi line lambda just means just prior to where you use it you'd just have a "def f ...".