Freedom, economy and information technology.
Random header image... Refresh for more!

Python functional programming

This entry is part 6 of 7 in the series Programming Languages

This article is a work in progress: it will be expanded by your comments…

Python is a very curios programming languages: it give you classes but also a strong function-oriented environment to play with. So, if you like functional programming (read: you like  Lisp and/or Erlang)  you should give python a closer look.

Python offer a huge set of feature previously available only on functional programming languages, like:

  1. Dynamic definition of function/inner classes on the fly. This feature has been extended to compete with highly dinamic languages like ruby
  2. Generator expressions
  3. List comprehensions
  4. Lambda functions

The itertools package (since Python 2.3) give you the ability to easily combine the generator functions.

List comprehensions was considered a powerful feature when introduced inside Erlang: and you get for free on python!

To give an hint of this power, I suggest you some interesting stuff like

Dynamic definition of function/inner classes on the fly. This feature has been extended to compete with highly dinamic languages like ruby

Series Navigation«Commodore BASIC as a Scripting Language Open SourceClosure in Java: fast and nice!»

0 comments

There are no comments yet...

Kick things off by filling out the form below.

Leave a Comment

(Required)

(Required)