The Year of Python
From the IM logs:
Joyce: Boy, this is definitely the Year of Python
Joyce: Last year, people said "Python might be OK for prototyping Java"
Joyce: This year, it's more like "Java is the new COBOL"
Murph: python has been, if you'll excuse the pun, creeping up on us for a while.
Murph: it's funny, because python has had some killer apps for a while, but they've been pretty invisible
Joyce: Like what?
Murph: things like Mailman
Joyce: Oh, that's Python?
Murph: see?
posted Mon 6 Sep 2004 in /software/languages/python | link
What's new in Python 2.4
- 1 PEP 218: Built-In Set Objects
- 2 PEP 237: Unifying Long Integers and Integers
- 3 PEP 229: Generator Expressions
- 4 PEP 322: Reverse Iteration
- 5 Other Language Changes
- 6 New, Improved, and Deprecated Modules
- 7 Build and C API Changes
- 8 Other Changes and Fixes
(From LWN)
posted Thu 17 Jun 2004 in /software/languages/python | link
python - 70MB/s
I did a simple test the other night of how fast Python can read/write data. A simple 'cat' in Python can pump data through at about 70MB/s on a Pentium M laptop. This is just with simple read() and write() into strings, without any special tricks. By contrast bzip2 on that machine is only about 300kB/s.
That's probably pretty slow compared to C, but faster than most network connections could sustain. It's an interesting data point for writing moderate-performance software in Python.
(Doing a lot of manipulation might well slow it down.)
posted Wed 21 Apr 2004 in /software/languages/python | link
Beginners mistakes in Python
Hans Nowak wrote a good short article on beginners mistakes when moving to Python from some other language.
To preserve cosmic balance, Richard presents anti-pitfalls: mistakes that you can't make in Python that are possible in other languages.
posted Fri 12 Sep 2003 in /software/languages/python | link
nice Python Generators example
Todd links to a good example of generators in Python. You can do things like this in many languages with varying degrees of ease. In C you probably need to explicitly store all your state; in Scheme you probably need to explicitly get your head around continuations. Python is arguably the first mainstream language to add them as a first-class feature. It will be interesting to see how much people pick them up and use them. They're probably not something you want to use very often, but when you want them they're very handy.
The "level of elegance" in providing explicit generators is very typical of Python: you certainly could factor them into smaller components and write the rest as a library, but it's perhaps easier to use them in this packaging.
def genResults(db, sql):
cursor=db.cursor()
cursor.execute(sql)
while 1:
row=cursor.fetchone()
if row is None: break
yield row
posted Wed 18 Jun 2003 in /software/languages/python | link
Archives 2008: Apr Feb 2007: Jul May Feb Jan 2006: Dec Nov Oct Sep Aug Jul Jun Jan 2005: Sep Aug Jul Jun May Apr Mar Feb Jan 2004: Dec Nov Oct Sep Aug Jul Jun May Apr Mar Feb Jan 2003: Dec Nov Oct Sep Aug Jul Jun May
Copyright (C) 1999-2007 Martin Pool.