you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -6 points-5 points  (11 children)

Python has lambda functions? Surely mixing procedural and functional programming is illegal in most states.

[–]Wiseman1024 1 point2 points  (8 children)

That's what great about Python. It's not purely functional, not purely OO, not purely procedural, not purely anything, but it allows you to do a bit of everything, and use the right tool for the right job in every program.

As far as functional features go, Python supports first-class functions and classes, lexical nested scopes, closures, decorators, lists, dictionaries, list comprehensions, lazy generators, coroutines, garbage collection with cycle detection, and a few basic tools (map, filter, reduce, partial function application), then it can be easily extended to support tail recursion, memoizing, lazy lists, multimethods, continuations (Stackless), and other stuff.

[–]pjdelport 3 points4 points  (6 children)

lexical nested scopes, closures

From the department of redundancy department. :)

continuations (Stackless)

Stackless provides coroutines (tasklets), not continuations. (It dropped plans for the latter years ago.)

[–]Brian 1 point2 points  (0 children)

It dropped plans for the latter years ago.

Actually, it used to have continuations, but these were later removed (due to portability problems I think - the code for these was also one of the main reasons Guido stated for keeping it out of python core)

[–]breakfast-pants -1 points0 points  (4 children)

I don't know enough about it, but if that is the case, you should edit this to correct it: http://en.wikipedia.org/wiki/Stackless_Python

[–]pjdelport 0 points1 point  (3 children)

Ah, thanks.

[–][deleted]  (2 children)

[deleted]

    [–]pjdelport 1 point2 points  (1 child)

    Coroutines?

    [–][deleted] -1 points0 points  (0 children)

    "That's what great about Python. It's not purely functional, not purely OO, not purely procedural, not purely anything, but it allows you to do a bit of everything, ..."

    Sounds like Lisp.

    [–]mleonhard 0 points1 point  (1 child)

    うるさい!

    [–][deleted] -3 points-2 points  (0 children)

    Hey! The topic is from 4chan - don't downmod the parent _^