Python 2.5 Released
dominator writes "It's been nearly 20 months since the last major release of the Python programming language, and version 2.5 is probably the most significant new release of Python since 2.2. The latest release includes a variety of additions to the standard library, language extensions, and performance optimizations. This is a final release, and should be suitable for production use. Read the release announcement, the highlights, what's new, and download it."
for Talk Like A Python Day....
.... never mind.
oh wait,
"Python copies even features [from Lisp] that many Lisp hackers consider to be mistakes." -- Paul Graham
Intron: the portion of DNA which expresses nothing useful.
finally, a joke on the right lines...
34486853790
Connection too slow for X forwarding? Try "ssh -CX user@host"
I know this is offtopic but does anyone know what happened to the python challenge?
There have been no new levels for a long time.
For those who haven't seen it, the python challenge is a great way to learn python.
Any recommended resources for starting out on Python?
I'm surprised that was never taught at the local community college since the computer department dean started the Unix Administration class this semester with a story about killing a rattle snake at his home in the country. With the end of the shotgun less than two inches away from the snake's head, there wasn't too much left to worry about bees getting into the venom.
From TFA:
In keeping with the theme of adding tried and true packages to the standard library, in 2.5 we've added ctypes, ElementTree, hashlib, sqlite3 and wsgiref to the standard library that ships with Python.
That made me sit up and take notice. A pretty nice programming language with built-in functionality to read and write Sqlite databases natively?
Looks like they release a Mac installer, too. Think I'll have to check it out when I get home
Cheers
It is good to finally see inline conditions such as:
This just makes me happy!
I won't join Slashcott. OTOH, If Beta goes live, I just won't be back until it's fixed. Sorry Dice.
Finally! Of course they have the most bass-ackward possible syntax, but at least they're there.
En taro Adun.
This release is worth the upgrade just for the new try, except, else, finally syntax. Never could figure out why Guido was confused by it...
"A Mathematician is a machine for turning coffee into theorems." ~ Paul Erdos
Their server seems to be taking a beating, so I can't get the exact URL. They have a decent tutorial. Just go to python.org-> documentation-> tutorial. If you are programming savy, you can just skim it, slowing down for unusual stuff.
The sys module has some interesting things in it that you might want access to early on. for example:
sys.argv
sys.stdin
sys.stdout
sys.stderr
I won't join Slashcott. OTOH, If Beta goes live, I just won't be back until it's fixed. Sorry Dice.
My life for Aiur!
It's hard to believe that's how Micronians are made. Why don't we see it right now by having you both kiss one another?
Python, the brightest programming gem. ;-)
Log Buffer
Hey!
This is a time and place for us python nut-cases. Ruby wackos can go release thier own new versions...
(Just messing with you, but your comment was a cheep shot)
I won't join Slashcott. OTOH, If Beta goes live, I just won't be back until it's fixed. Sorry Dice.
It's also nice when dealing with a language like python to know some of what c/c++ is doing behind the scenes. I'm certainly no expert in the python c api, but what little I know helps me keep things in perspective.
I won't join Slashcott. OTOH, If Beta goes live, I just won't be back until it's fixed. Sorry Dice.
Why did you post this? Why point out there religion?
try {} catch (...) {} finally {}
What is the point of else? What does it get you that you didn't have just as easily without it? If no exception is thrown, run it? Isn't that what the content in the try section is for? Will someone provide a use case for this for me please?
- I don't need to go outside, my CRT tan'll do me just fine.
http://www.diveintopython.org/
For those that know how to program. Accept no substitutes.
Ugh, where did this meme come from?
I think Paul Graham looked at Python 1.0, saw that it had a "lambda" in there somewhere, and had a little orgasm in his pants. Then he wrote an article about it and the Python fanatics didn't realize what he meant was, "compared to C++, COBOL, and FORTRAN, Python is a lot like Lisp". So every now and then, somebody comes along and compares Python to Lisp (favorably or unfavorably).
Python rarely uses "lambda" these days, I think Guido has "deprecated" that kind of usage pattern, and Python doesn't have MACROS, which are kinda what makes Lisp. And of course, no s-expressions (and the whole whitespace thing makes Python even HARDER to parse than other langauges).
Now Ruby has the anonymous function thing ("blocks") which lets you do some of the same things you can do in Lisp with Macros, and Ruby generally "feels" more like Lisp to me (but it's no replacement for Lisp either). And Perl, even though the syntax is awful, is even *more* like Lisp, if you can believe it (you can do "blocks" in Perl as well for instance, though I hardly ever see it, and you can "roll your own" objects as in Lisp).
So please, let's stop pretending that Python is "Lisp" in any way shape size or form.
Or: if a==b then "first option" else "second option"
Although that would mean adding a new keyword.
Still, I'll take what I can get.
I won't join Slashcott. OTOH, If Beta goes live, I just won't be back until it's fixed. Sorry Dice.
Does anyone knows a good tutorial for application migration from Python to Ruby?
anyone using wxpython will need to upgrade to wxpython for python 2.5
http://www.wxpython.org/download.php
as soon as i'd installed python 2.5 all my app died, took me a few mins
to realise that py2.5 breaks wxpython for py2.4, and some tk demo's ran:)
I'm a rabbit startled by the headlights of life
Ouch ;)
Tip #1: I highly recommend adding pyrepl to your Python environment. It enhances functionality of the interactive interpreter such that you can easily edit multi-line code snippets. Forward and back (control-n, control-p) through history. Control-r (then start typing) to find something back in history. Very useful. http://codespeak.net/pyrepl/
Tip #2: Avail yourself of the help() function in the interpreter. help(SomeObjectOrFunction) i.e. help(open) will return the docstrings associated; help(SomeModule) i.e. import sha; help(sha) will return the module docs.
PS: For those that don't read docs or code, following installation of pyrepl, to launch a pyrepl-enhanced interpreter, at the command prompt: pythoni
Huh? The creator of Ruby, Matz, over in Japan, is Mormon?
What I'd like to know is: Are there any breaking changes? Will 2.4 modules and code still work?
I don't know. Back in the day, I wrote a simplified Lisp interpreter to run on a 6802 microprocessor in 64K. It seemed like the easiest way to run a realtime dispatching algorithm - kind of a rule-based expert system. You can get Lisp going with about a dozen hard-coded ops and write everything else in Lisp. I haven't seen a better way to do it since then, although I like stack-based languages for embedded systems also. Postscript is my favorite. One of the few embedded projects I've worked on that completely failed was written in C.
Intron: the portion of DNA which expresses nothing useful.
Well python is a multiparadigm language and fairly flexible, but it doesn't go far beyond OO, imperative and lightweight functional styles.
It's not fit at all for logic programming, DBC and AOP are not that cool (even though decorators make them at least possible without being too damn ugly), and hardline functional programmin is impossible due to lack of support for recursions (Python doesn't optimize tail-recursion), absence of pattern-matching and mutable states.
Oh, and it has no support whatsoever for distributed or heavy concurrent programming.
"The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
As it turns out yes, check out this mailing list post http://comox.textdrive.com/pipermail/talk/2005-Dec ember/000435.html
It would seem that Guido is not religious. There is a quote at http://lambda-the-ultimate.org/classic/message3555 .html stating as much.
Glad to see ElementTree's gone into the main Python distribution - it's a very nice way of working with XML, and the one I generally use if I have the choice (IMO it has a nice, clean, Pythonic API which generally fits with what I want to do, though it does require you to load the entire XML tree into memory before you do anything with it).
I've been using Python in Pails for about 3 months now and absolutely love it. It's the only Web 2.0 compliant framework I use for dynamic database driven website creation. It's flexible too, unlike some other tools that ascribe to the one size fits all mentality (PHP we're looking at you). Pails let's you choose a thimble (small framework) for your small customer websites or a full blown pail for your enterprise sites. I'm looking forward to getting wrapped up in this new version of Python, but I can't get out of pails at this point. So if anyone knows... I'd be much obliged.
Ah, that must be why Python does no miracles for me.
I'm using a book called Python Programming for the Absolute Beginner. It explains all the data types and stuff which does get a little annoying if you already know another programming language, but it cost $15 less than Dive Into Python. I think one of the guys in my dorm is going to borrow it because he needs those explanations (first language).
look! it's a bird, it's a plane, it's....a girl? yes, a girl browsing Slashdot on Linux
Somehow, I get the feeling that avionics software is too time-sensitive for interpreted languages, but I've never done it before, so I don't really know.
"The use-mention distinction" is not "enforced here."
Yes, but not on mother fucking planes.
HTH.
You're obviously not using lisp for interoperabilit with others, so why not learn a language that's fixed the most glaring faults in lisp while staying very true to its principles? Besides, bad programmers can still write lisp macros: Put a backtick at the start, and a comma before every argument. Not that hard really.
:)
Now, if you want a challenge, learn a pure functional language instead of one that only goes half way...
[...] Ruby focuses on expressiveness (an inherited "there's more than one way to do it" from the Perl in its genes), and Python focuses on clarity and readability.
But... the point of expressiveness is to make code more readable, by reducing the semantic gap between your language and the problem domain (a concept which is at the heart of the idea of domain-specific languages, which you mentioned as being part of the Ruby approach).
The fact that a language has fewer constructs than another only makes code in that language "clearer" if you assume that clarity consists in it being easier to figure out the low-level details of the code in question ("ok, here it's setting up a loop counter variable, then it's testing whether it exceeds x, then it's..."). If the standard, on the other hand, is to convey what a program is trying to do at a high level, the limitations that get you that "clarity" will hurt you.
Are you adequate?
So this is like Common Lisp unwind-protect special form. :)
:P
Nice feature
Ohh sorry, I just forgot that Python is trying not to be more Lisp-like!!
We are Turing O-Machines. The Oracle is out there.
I'm not sure about that,
But there are certainly planes on a snake
Err... I think you have your definitions mixed up. Forward compatibility is the ability to accept (even if "accept" simply means ignore without error) input that is designed for future use - for example, Python 2.4 would be forwards compatible with 2.5 if you could use it to run code containing "with" statements, accepting the caveat that the code blocks they contained wouldn't be executed (but would "magically" begin to work if you switched to 2.5 - AFAIK, 2.4 is NOT forward compatible in this manner, this is simply an example). A more useful example is in HTML, where forwards compatibility is achieved by browsers simply ignoring tags they do not understand, and treating their content as plaintext - this is how the "noscript" tag works: old browsers ignore the tag and print the content, new browsers know to pretend both tag and content aren't there when JavaScript is available.
Backward compatibility would be the ability of Python 2.5 to completely replace Python 2.4 in current usage scenarios with code changes on the level of little to none. It is the ability of a new version of a system to accept input designed for an older version, and still produce sane, expected output.
The ability to communicate ideas is quite a fundamental point in if you are, or are going to become, a programming professional. The term "backwards compatible" should be in every serious programmer's vocabulary, and I have yet to use it in a face-to-face conversation a programmer who so much as hinted that they didn't think it meant exactly the same thing I do. Forward compatibility is less common; in fact, I actually had to look up a definition to check I had the right idea!
It is there: Python 2.5
And they are already fixing packaging problems: 2.5-r1
Bear in mind Gentoo may take longer than most to fully switch over to 2.5, since Portage itself is written in Python. They have much more to lose from getting this wrong than Debian. I have used Debian in the past, but have been a Gentoo user for a few years now; I have noticied a backing off - intentional or otherwise - from the old "bleeding edge" tendencies over the past few months, but I for one am not particularly bothered, provided it isn't indicative of infrastructure problems and doesn't become a growing trend of getting further and further behind. (I have no evidence that it is either of these things, just a bad gut feeling based on some of the not-so-good times I've had with the distro.)
If you're talking about Jim Hugunin, he handed the project off to others before he left it. But development just plain hasn't been the same since he left.
Ruby also allows an else block in the case that no exceptions are caught. I have not yet thought of a good use for it, but it is there.
They don't grade fathers, but if your daughter's a stripper, you fucked up. --Chris Rock
Shouldn't that be:
(= (+ Slashdot Python) zealotry)
If we're talking about Lisp?
"Lisp
By implementing the Common Lisp operator unwind-protect :P
:D
In case you miss it, the one Python calls WITH.
Don't worry, you can update your paper, and then in Python 3.0 they will copy something else
We are Turing O-Machines. The Oracle is out there.
Hmmm... it looks like Twisted framework didn't make it into the standard library (yet?).
cpghost at Cordula's Web.