Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Python 2.4 Final Released

CmdrTaco posted more than 9 years ago | from the watch-out-for-the-teeth dept.

Programming 359

Eventh writes "The final release of Python 2.4 was just released. Python 2.4 is the result of almost 18 month's worth of work on top of Python 2.3. New features are, but not limited to, function decorators, generator expressions, a number of new module and more. Check out Andrew Kuchling's What's New In Python for a detailed view of some of the new features of Python 2.4. "

Sorry! There are no comments related to the filter you selected.

In Corea... (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10953424)

the elderly love giant Pythons!

Re:In Corea... (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10953488)

In America, we love Alabama Blacksnake in our pussies (if you catch my drift). Call 183278885 if you are black and in need of a good white cock-maid.

FP! (0, Troll)

imbaczek (690596) | more than 9 years ago | (#10953425)

Let the decorator bashing begin!

Just in time for Xmas! (3, Funny)

FooAtWFU (699187) | more than 9 years ago | (#10953545)

No! It's the Christmas season, so decorations are in right now! We should all get the new version of Python and decorate our source code to celebrate the spirit of holiday cheer!

cue grumbling about how Christmas is overcommericalized+etc

Re:FP! (0)

Pxtl (151020) | more than 9 years ago | (#10953712)

@this
@is
@an
@ugly
@character
def is(it, not):
pass

Re:FP! (2, Funny)

nkh (750837) | more than 9 years ago | (#10953839)

Grrr, the @ sign is the Ruby way to declare an instance member. This is a declaration of war I say!!! (next thing he'll do is to drop the indentation and add end at the end of all the blocks ;)

FP Man (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10953440)

First Post. bwawahahaaaa

18 Months (4, Informative)

nijk (781345) | more than 9 years ago | (#10953442)

It took them a while, but it's worth it. Here's some of the new features:

* multi-line imports - when using imports in the form from foo import bar, baz, bing, bang, you can surround the imported names with brackets, and they can be split across lines. This is part of PEP 328.
* Farewell to OverflowWarning - as documented in PEP 237, Python no longer generates OverflowWarnings.
* function/method decorators - function and method decorators, first described in PEP 318, have been added to the language, using 'pie-decorator' syntax. Decorators are on the line before the 'def', and prefixed with an '@' sign. (PEP 318)
* Assigning to None - the compiler now treats assigning to None as a SyntaxError.
* Failed import cleanup - when a module import failed, versions of Python prior to 2.4a2 would leave a broken module in sys.modules - subsequent attempts to import the failing module would silently succeed, but use the broken module object. The import machinery now removes the failing module from sys.modules if the import fails.
* The -m command line option - python -m modulename will find a module in the standard library, and invoke it. For example, python -m pdb is equivalent to python -m /usr/lib/python2.4/pdb.py

Re:18 Months (1)

davesplace1 (729794) | more than 9 years ago | (#10953495)

Looks like a lot of good improvements, still takes me a couple of weeks to get used to new features. All in all Python 2.4 looks great IMHO.

Re:18 Months (-1, Flamebait)

Anonymous Coward | more than 9 years ago | (#10953537)

But did they get rid of the whitespace annoyance?

Seriously.. Curly braces have been around a while, and can't be that hard to parse.

genexps (5, Insightful)

ultrabot (200914) | more than 9 years ago | (#10953569)

You forgot the most important improvement, the "generator expressions".

From the AMK's excellent (as always) overview:

print sum(obj.count for obj in list_all_objects())

The important part is that no intermediate list is generated, because we are dealing with generators.

Generators in general kick so much ass it's not even funny.

Re:genexps (2, Informative)

percivall (651934) | more than 9 years ago | (#10953809)

Yeah, generators do kick ass.

But it's important to remember that generator expressions are slower than list comprehensions. This is mainly because functions calls are expensive in Python, and when dealing with generators each iteration means one more function call.

fp (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10953445)

w00t!

In Korea... (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10953446)

...Python is for the elderly!

In Korea...Elderly Flavoured Toothpaste. (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10953661)

" ...Python is for the elderly!"

Pythons eat the elderly.

function decorators (4, Funny)

koi88 (640490) | more than 9 years ago | (#10953448)


Finally I can make my functions so much prettier.

Re:function decorators (1)

nijk (781345) | more than 9 years ago | (#10953477)

Actually, I find decorators to be quite ugly. :-(

Re:function decorators (1)

MikeBabcock (65886) | more than 9 years ago | (#10953879)

I concur ... but I just won't use them in all likelihood.

If I run into code that uses them, that's another story.

hell ya (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10953450)

oh yeah, first post

Damn (-1, Redundant)

Anonymous Coward | more than 9 years ago | (#10953481)

I just purchased Learning Python, it should be arriving in the next few days. I knew this was comming out, but didn't want to wait for a 2.4-specific book to be published.

Oh well.

OK Trolls... (3, Funny)

Anonymous Coward | more than 9 years ago | (#10953483)

If you can keep your "significant whitespace sucks" comments as children of this one, I'm sure everyone will get along just fine...

Re:OK Trolls... (1)

TychoCelchuuu (835690) | more than 9 years ago | (#10953503)

Significant whitespace sucks? Blasphemy. I add significant whitespace even when it's not neccesary!

OK Trolls...Arthritis. (0)

Anonymous Coward | more than 9 years ago | (#10953687)

"Significant whitespace sucks? Blasphemy. I add significant whitespace even when it's not neccesary!"

Typing sucks.

Re:OK Trolls... (1)

nkh (750837) | more than 9 years ago | (#10953733)

I read two Python books and (I still don't like this language but) whitespace is not one of its problems. <troll>You have to admit it's very confusing for n00bs (especially if you look into some real OSS programs)</troll> but it's definitely no more an issue after one chapter of a good book [diveintopython.org] .

Re:OK Trolls... (1, Insightful)

rhaig (24891) | more than 9 years ago | (#10953701)

whitespace, when used correctly, makes code readable. However, having the inability to be flexible with the use of that whitespace bugs me.

coding standards make good code, not a language. I can write bad python just as easially as I can write good perl.

Re:OK Trolls... (-1, Flamebait)

Anonymous Coward | more than 9 years ago | (#10953746)

no such thing as "good Perl" so try again.

Re:OK Trolls... (1)

NardofDoom (821951) | more than 9 years ago | (#10953887)

Example: Say you're debugging a script on an 80 character wide TTY display. Do you really want to go through each line, scrolling all the way to the end because your language has significant whitespace?

Just like a Wookie on Endor, it doesn't make sense.

Re:OK Trolls... (1)

grumbel (592662) | more than 9 years ago | (#10953935)

One of the biggest drawback of the whitespace issue is that you don't get a real lambda in Python for basically just that reason. The lambda that is in Python is limited to a single expression (ie. single line) and thus beside trivial stuff completly useless. Naming functions kind of really sucks if all you wanna do is something very little.

The whitespace issue makes of course other things like copy&paste a whole lot harder too.

Overall I just wish they would introduce some kind of construct to get away from thet whitespace issue be it {}-blocks or whatever, but its probally to late for that now. Lack of Whitespace is one of the reasons I prefer Ruby, while it has some uglynesses by itself, it doesn't feel like I am always punished by the language.

Don't call me white (0)

Anonymous Coward | more than 9 years ago | (#10953773)

The connotation's wearing my nerves thin
Could it be semantics generating the mess we're in?
I understand that language breeds stereotype
But what's the explanation for the malice, for the spite?

heh (5, Funny)

boschmorden (610937) | more than 9 years ago | (#10953492)

import overlords

print "I for one welcome our new %s overloads.!" % overloads.get_random()

Re:heh (1)

TeknoHog (164938) | more than 9 years ago | (#10953877)

$_=~s/loads/lords/g;

My 2 cents (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#10953504)

IMHO why settle for snake oil when you can have the whole snake?

department of redundancy dept. (4, Funny)

Anonymous Coward | more than 9 years ago | (#10953529)

The python final release of python 2.4 is finally released for python users out there who wish to use the final release of python release final.

In a certain east asian country... (-1, Troll)

tod_miller (792541) | more than 9 years ago | (#10953580)

In Korea, only old people use Python!

Seriously though, I can see *BSD and Mac users being so wound up by this!

Python is cute. There, on topic enough?

laugh, the christmas spending spree has started

Re:In a certain east asian country... (0)

Anonymous Coward | more than 9 years ago | (#10953703)

This is not about cute. Anyone smart enough, would have python or ruby in their toolbox. Prior to python, I was one of those few who swore by C, I would code anything in C or assembly. C was as high level as I wanted to go, high level langauges for the most part disgusted me. But since I got into python. 99% of my code are python, a few in C. Python is the turbocharger of programming languages.

segmond

Re:In a certain east asian country... (0, Offtopic)

Justin205 (662116) | more than 9 years ago | (#10953713)

In Korea, only old people use Python!
In Soviet Russia, Python uses you.

Let the bad "In..." joke wars start!

Re:In a certain east asian country... (0)

Anonymous Coward | more than 9 years ago | (#10953824)

Only old people ..?
Are you talking about north Korea? :)

I think many open-source developers in south Korea are familiar with Python.

generator expressions? (3, Funny)

deathazre (761949) | more than 9 years ago | (#10953587)

2,500KVA @ 0.8 PF? (note: some electrical background required to appreciate the above)

aargh. (1)

deathazre (761949) | more than 9 years ago | (#10953621)

and of course I managed to forget (again) that comments, being HTML formatted, ignore whitespace.

Re:aargh. (2, Funny)

Anonymous Coward | more than 9 years ago | (#10953802)

and of course I managed to forget (again) that comments, being HTML formatted, ignore whitespace

Can't say the same thing about Python. ;)

Re:aargh. (0)

Anonymous Coward | more than 9 years ago | (#10953910)

You insensitive clod!

On Decimal and floating point (4, Interesting)

Frater 219 (1455) | more than 9 years ago | (#10953589)

The What's New document gives a somewhat inaccurate description of the importance of the Decimal type. Naturally, switching from binary to decimal changes which fractions can be exactly represented, but it does not change the fact that some cannot.

The importance of decimal arithmetic is not that it is more accurate than binary, but rather that it conforms more closely to what people expect from using decimal in daily life. These expectations are codified into various social rules such as accounting practices.

There's been some heated discussion of Python 2.4's Decimal, in this very regard, on the Lambda the Ultimate [lambda-the-ultimate.org] languages blog.

Re:On Decimal and floating point (1)

mwlewis (794711) | more than 9 years ago | (#10953745)

Actually, decimal arithmetic is more accurate than binary. Any binary fraction can also be represented in decimal, but not all decimal fractions can be represented in binary, since 2 divides 10 evenly, and 5 doesn't divide 2 evenly.

Re:On Decimal and floating point (3, Funny)

pkhuong (686673) | more than 9 years ago | (#10953816)

So, obviously, we should be using base (apply '* *n-first-primes*). How about 30 or 210? At least it's not an arbitrary base.

Re:On Decimal and floating point (1)

SamBeckett (96685) | more than 9 years ago | (#10953864)

This is why we still have 60 and 360 as common bases-- the ancient one's need to avoid confusing fractions.

Incidentally, 60 = 2*2*3*5 and 360 = 2*2*2*3*3*5

Heated Discussion? (1)

Senjutsu (614542) | more than 9 years ago | (#10953905)

That entire "debate" consists of one idiot flipping a shit because of a poorly worded snippet from a pre-release version of the "What's New?" overview. He didn't even bother to reference the appropriate PEPs and documentation before grossly misrepresenting the point of the new Decimal type.

No, the Decimal type isn't IEEE 754 standard. No, it doesn't solve, or intend to solve, all the world's numerical analysis problems. Yes, it is a good thing in a language intended to minimize the dissonance between user expectation and actual result.

frozenset (4, Interesting)

hey (83763) | more than 9 years ago | (#10953591)

Instead of having a special keyword for immutable sets (frozenset) wouldn't it be better to have an "immutable", "final" or "const" keyword?!

Re:frozenset (1)

ultrabot (200914) | more than 9 years ago | (#10953644)

Instead of having a special keyword for immutable sets (frozenset) wouldn't it be better to have an "immutable", "final" or "const" keyword?!

Where would you put that keyword?

s = frozen Set()

where frozen would do some kind of lookup in a table that has a non-mutable equivalent of every class?

That wouldn't make much sense. Providing a freeze() function might be more sensible, where it would always call obj.__freeze__ if applicable, telling the object to lose all the mutability...

Re:frozenset (0, Troll)

Pxtl (151020) | more than 9 years ago | (#10953888)

Because that would be consistent. What, haven't you ever used Python? Its no less a hack than Perl, its just a much more legible, better documented hack.

I *want* to be enthused, but... (0, Troll)

danielrm26 (567852) | more than 9 years ago | (#10953597)

...after Linus's comments I am inclined to get more profficient with Bash and C and almost ignore Python completely. It's so dissapointing though - I really wanted to learn Python; it's such a neat language.

Alas, there just isn't that much of a reason for me to since most of what I want to do can be done with Bash. This is a reality I don't want to face.

Re:I *want* to be enthused, but... (2, Insightful)

donniejones18 (749882) | more than 9 years ago | (#10953639)

What were Linus' comments?

Re:I *want* to be enthused, but... (1, Informative)

Anonymous Coward | more than 9 years ago | (#10953656)

Someone elaborate a little? Maybe even give us a link?

Re:I *want* to be enthused, but... (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#10953673)

LOL! Buhahahahahahahahhaha!
Can I please get some of what you are smoking and/or drinking this morning.

segmond

Re:I *want* to be enthused, but... (1)

Anonymous Coward | more than 9 years ago | (#10953678)

Let me paraphrase you : "I *want* to be enthused, but ... someone told me not to be."

Way to have a backbone, kiddo.

Re:I *want* to be enthused, but... (5, Interesting)

ultrabot (200914) | more than 9 years ago | (#10953697)

after Linus's comments I am inclined to get more profficient with Bash and C and almost ignore Python completely. It's so dissapointing though - I really wanted to learn Python; it's such a neat language.

Linus explicitly mentioned that he doesn't do anything "in the middle" - it's either kernel hacking or something trivial enough to do with bash. Just go ahead and learn Python - you will find that it's *easier* than bash, especially if your programs might have errors (which they do).

BTW, why would you want to get more proficient in C? Programmers are abandoning C in droves. It's just not programmer-time efficient to do things in C anymore. It's one thing if you are maintaining a project that was written in C originally, but for new projects, C is a non-starter.

Go read ESR's "The Art of Unix Programming", available online for free.

Re:I *want* to be enthused, but... (4, Insightful)

oexeo (816786) | more than 9 years ago | (#10953821)

BTW, why would you want to get more proficient in C? Programmers are abandoning C in droves. It's just not programmer-time efficient to do things in C anymore. It's one thing if you are maintaining a project that was written in C originally, but for new projects, C is a non-starter.

I think one of the problems is too many people are still spreading the myth that it's essential to learn C before moving on to C++, which is totally false, C++ is a language in itself, and can be treated as such. Learning C (unless you intend to use it) is a waste of time, and I would go so far to say learning C first will make you less producive in C++, because it teaches concepts which are not applicable, or are actually bad habits when used in C++. At least that's my view on the subject.

That said, C still has its uses, but for many projects (like parent said) it's a "non-starter"

Re:I *want* to be enthused, but... (1)

nb caffeine (448698) | more than 9 years ago | (#10953698)

Why not learn it, if it is such an neat language (ive dabbled a bit in python after i had to write a semester paper on it, you're right, it is a neat language)

Re:I *want* to be enthused, but... (0)

Anonymous Coward | more than 9 years ago | (#10953709)

then you don't want to do much.

Re:I *want* to be enthused, but... (1)

Chris84000000 (735658) | more than 9 years ago | (#10953758)

Addmittedly yes...

Python is not optimal for system administration, but that's because its focus has moved away from system administration (if it ever was there in the first place). Let Perl have it, or bash. I use it now not as much for system administration as for actual development of my projects, and for that I find it faster to develop than C(++) or Java.

And I don't want to start any flames, this is my opinion.

Re:I *want* to be enthused, but... (1)

egarland (120202) | more than 9 years ago | (#10953803)

If you are looking to do something that Bash can do but probably shouldn't (most things people use Bash for fall into that category) use perl, not python. Perl is very bash-like and porting things to perl is easy.

Of course, this is why so many perl programs look like a complete mess, people do quick ports and don't learn how to properly use the language. Do the next guy a favor and do "man perlstyle" early on.

Re:I *want* to be enthused, but... (3, Insightful)

Anonymous Coward | more than 9 years ago | (#10953833)

Here's a novel idea: Use the right tool for the job. There's a very large class of problems for which neither c nor bash are particularly appropriate programming languages. I suspect that Linus was attempting to comment on the partcular classes of problems on which he typically works, not on the merits of any specific programming language. If everything you're doing now can be done with bash, then use bash. However, don't rule out Python just because Linus doesn't use it. One day, you'll need to do something that's impractical with bash, and you'll find Python quite useful.

I use Python extensively in my day-to-day work. It's the most versatile tool in my toolbox, and I'm continually amazed that so few people, at least around here, use it.

In korea.... (-1, Redundant)

Anonymous Coward | more than 9 years ago | (#10953599)

In Korea only old people release the python.

Is it called final because... (0, Troll)

tod_miller (792541) | more than 9 years ago | (#10953615)

People say 'Oh, 2.4, Fiiinally, took thier time!'

Like, hordes of old koreans...

This is more infectious that a mutated H5N1 virus [google.com] ! :-)

Python annoyances (2, Insightful)

Anonymous Coward | more than 9 years ago | (#10953625)

Python is a pretty good language for general use and for teaching. If fact, what got me interested in Python was a story (on Slashdot) about programmers at Sun saying that Python was a better language than Java in their environment.

Having said the above, there always seem to be 'issues'. Floating point numbers are one such issue. This release fixes that with 'Decimal'. The trouble is, you have to know about 'Decimal' before you can use it. This raises the difficulty of using Python.

I find that I write code quickly and then spend an hour researching some module or other. It sure slows down the process.

Re:Python annoyances (0)

Anonymous Coward | more than 9 years ago | (#10953735)

researching a module is part of learning any language, if you are using perl or ruby you have to learn about the modules. if you are using java, you have to learn about the packages, if you are using C, you have to learn about the libraries. learning is an investment. it takes once to learn modules.

learning python modules is easier than in other languages, a lot of times, i don't even have to grab the documentation.

all one has to do is

import somemodule
dir(somemodule) and you can see the classes, functions available. with dir() you could figure out so much so fast. ]

segmond

Re:Python annoyances (0)

Anonymous Coward | more than 9 years ago | (#10953776)

Try Ruby.. it was designed properly to begin with.

Re:Python annoyances (1)

kfg (145172) | more than 9 years ago | (#10953868)

I find that I write code quickly and then spend an hour researching some module or other. It sure slows down the process.

This is a problem inherent in OOP. It is often quicker to write your own classes (which you then understand innately), at least if you actually understand the mathematics of the problem you're working on, than it is to find and research an existing one.

This degrades the value of the public investment in reusable code.

If Java seems more "intuitive" to you that is a result of the capital investment you've already made in research. In Java too you have to know something is there before you can use it.

KFG

Re:Python annoyances (1)

hrm (26016) | more than 9 years ago | (#10953908)

The decimal type offers a fix for a (very slight) inaccuracy that's inherent with floating point values on a machine level. It's not a programming language "issue" at all.

Having said that, I agree it takes some time to become efficient in Python. I wish/hope (ought to check again) that Python's potentially excellent built-in documentation string system becomes/is more accessible and useful. That'd help a lot with getting to know modules.

I've used 3 scripting languages over the times; I use bash for anything less then 10 lines, never using functions. Perl no longer, as I can learn the language, but my brain can't seem to remember the details longer than about a week --- don't know where the fault lies. That leaves me with Python for everything more than 10 lines.

Writing extensions... (2, Interesting)

mi (197448) | more than 9 years ago | (#10953653)

I do not see "Extensions API" anywhere on the list of improvements. Last I tried, creating one's own object type or even a simple command was a rather tedious task, unlike in TCL...

Re:Writing extensions... (1)

ondelette (253185) | more than 9 years ago | (#10953753)

Actually, using SWIG, it is almost trivial to wrap a C++ object in Python.

Re:Writing extensions... (4, Informative)

imroy (755) | more than 9 years ago | (#10953912)

The Boost [boost.org] project has Boost.Python [boost.org] . I haven't used it yet, but the docs make it sound very interesting. It looks quite simple to write base classes in C++ and then subclass them in Python.

Dive into Python (4, Interesting)

cbelle13013 (812401) | more than 9 years ago | (#10953657)

I had absolutely no interest in Python until I read Slashdots review of Dive Into Python [slashdot.org] . Its right on target and got me excited to run home and see what I could do. Of course that only lasted for about a month, but I'll be sure to head home and take a peak at it again.

braces? (0, Redundant)

rhaig (24891) | more than 9 years ago | (#10953670)

has anyone written a module that will allow the use of braces rather than whitespace for code-block separation?

If anyone does that, then a lot of the reasons for bitching about python go away. (my reasons at least)

and I am NOT trying to start a python vs <insert language here> war. Just wondering if it's been done yet.

aside from the braces/whitespace issue, the fact that the debugger is an external module and can be problematic, I really like python. (well, it's been a few years since I used it, but it was nice then)

Pah (1, Funny)

potcrackpot (245556) | more than 9 years ago | (#10953679)

Any language I can't do the following in, I'm not using.
$a[0] = 7; $a[1] = 8;
@b = (5 x @a); @c = ((5) x @a);
print "@b @c";

Re:Pah (1)

ezzzD55J (697465) | more than 9 years ago | (#10953798)

Hm, what's so special about that?

Re:Pah (5, Funny)

Anonymous Coward | more than 9 years ago | (#10953812)

python -c 'print "55 5 5";'

Re:Pah (0)

Anonymous Coward | more than 9 years ago | (#10953894)

Those who do not understand lisp are doomed to re-implement it ... badly.

Python is a pathetic language. (-1, Troll)

i_am_pi (570652) | more than 9 years ago | (#10953734)

Seriously, why should you run an interpreted language with a scant collection of modules, an annoying demand for whitespace, unreadable syntax, and various other issues.

Python lovers claim that the language reads like pseudocode, and "that's it's biggest advantage"... Oh really?

What the fuck is this supposed to mean?
processFunc = collapse and (lambda s: " ".join(s.split())) or (lambda s: s)
pseudocode readability my ass.

I'd much rather use perl, where at least the unreadability makes a bit of sense:
print "$_\n" foreach (sort glob "/tmp/*")
I dare python lovers to write something like that in python in one line.

Re:Python is a pathetic language. (0, Insightful)

Anonymous Coward | more than 9 years ago | (#10953815)

Why don't you try Ruby? It's like if Python was designed properly to begin with.

Here's your example in Ruby for instance:
puts Dir['/tmp/*']

Re:Python is a pathetic language. (5, Informative)

tuffy (10202) | more than 9 years ago | (#10953902)

I dare python lovers to write something like that in python in one line.

for f in glob.glob("/tmp/*").sorted(): print f
Though you will need to import glob in a seperate line. But I fail to see how doing trivial things trivially is a helpful measure of a language's usefulness.

Re:Python is a pathetic language. (1)

sunami (751539) | more than 9 years ago | (#10953909)

What the fuck is this supposed to mean?

processFunc = collapse and (lambda s: " ".join(s.split())) or (lambda s: s)


Way to go, and pick a complicated line to use as your example. I think by saying the language reads like pseudocode, they mean:

print 'hello, world'
answer = read_string('what is the answer')
a = str(a)

stuff like that. And don't think that all languages don't have this kind of unreadable code.

Good sir! You have misunderstood. (0)

Anonymous Coward | more than 9 years ago | (#10953925)

PERL is what happens when you fuse BASIC with a Macro language: maximum flexibility for filesystems. I 3 PERL and use it all of the time for this reason.

Python is the kind of language in which you could develop a small or midrange app without going nuts over mindless "complexity" in the task imposed by the client at the last minute while drinking Starbucks and circling their Jaguar around Central Park waiting for the Opera to start. IMHO.

I would code anything in Python, but I might fix up a library first to give me PERL-like ability on those files, text strings, etc.

jython? (1, Interesting)

Anonymous Coward | more than 9 years ago | (#10953777)

Any chance jython may be updated, soon? It seems it is two versions behind?

Supprised (1)

bogaboga (793279) | more than 9 years ago | (#10953782)

I was supprised that even though a good number of Slashdotters are programmers themselves, http://www.python.org/ [python.org] was not slashdotted.

Can one tell me why I should learn python and not any other programming language anyway?

From the little I have seen, python seems to be a command line language. Is it anywhere similar to Visual Basic, which I have come to see and experience through a GUI?

Use a toolkit (2, Informative)

gregarican (694358) | more than 9 years ago | (#10953861)

There are GUI toolkits which typically are added on as an extension to something like Python. I am learning Ruby and can choose from Qt, Tk, Wx, Fox, etc. As long as someone has created the extensions you are good to go.

Re:Use a toolkit (0)

Anonymous Coward | more than 9 years ago | (#10953923)

There are GUI toolkits which typically are added on as an extension to something like Python.

Care to name any?

Re:Supprised (1)

Stradenko (160417) | more than 9 years ago | (#10953931)

There are many gui widget libraries available for python, and several RAD tools to get into 'em quickly. Try Boa constructor http://boa-constructor.sourceforge.net/ [sourceforge.net] or google for pyglade

so....vPython? (1)

frogg320 (722290) | more than 9 years ago | (#10953785)

Is this going to outdate vPython now? If so, do you think we'll see an update any time soon?

If you like Python, (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10953790)

you may also appreciate this language [dur.ac.uk] .

Is it just me? (4, Interesting)

digitaltraveller (167469) | more than 9 years ago | (#10953799)

Or has python strayed from it's original philosophy of 'one best way to do it'?

I used python in the 1.5 days. The syntax was incredibly clean. Nowadays the language has tremendous idiomatic power, any programming language researcher should be familiar with it.

But that power has brough alot of complexity. At the end of the day, languages are tools and the learning curve to understand (particularly others) python code seems to be increasing.

Re:Is it just me? (1, Informative)

Anonymous Coward | more than 9 years ago | (#10953813)

python did not remove the easy way of doing things, the newbies can still use the simple syntax to get a lot done, and those who know a lot more can use the advanced features.

segmond

Re:Is it just me? (2, Informative)

Anonymous Coward | more than 9 years ago | (#10953862)

It's not just you.

The "eye opener" for me was reading the Python cookbook. Almost every recipe listed 2-3 ways to do everything, most of them hard to understand and using Python "tricks". Many of them depended on new 2.x features. I realized that there are now two kinds of classes in Python for instance.

The Python community has also grown arrogant like the Perl community. If a newbie writes something that can be re-written with a list comprehension for instance, it's pretty much given that nobody will actually answer his question, choosing instead to re-write his program for him using tricks and shortcuts.

I'm using Ruby almost exclusively for new projects and it just kicks Python's ass up and down the street. Simple, orthogonal, consistently designed to *begin* with, easy to read, small and friendly community.

But... (0)

Anonymous Coward | more than 9 years ago | (#10953822)

In Korea, only old people use Python.

Python recommended to *cough* newbies (1)

eXoXe (157466) | more than 9 years ago | (#10953823)

For anyone that's yet to get their feet wet with programming, Python is a great (easy) language to learn on. The flow of the language makes a lot of sense to beginners in my opinion.

Sets in Python (1)

stdcallsign (558206) | more than 9 years ago | (#10953854)

>>> a = set('abracadabra') # form a set from a string
>>> 'z' in a # fast membership testing
False
>>> a # unique letters in a
set(['a', 'r', 'b', 'c', 'd'])
>>> ''.join(a) # convert back into a string
'arbcd'

At first I was excited to learn that set was a built in type. But for the life of me I cant figure out what good it is when it only operates on characters. Except for perhaps argument checking, it seems rather useless if you cant operate on sets of words and objects rather than letters.

Re:Sets in Python (0)

Anonymous Coward | more than 9 years ago | (#10953913)

''.join(a)

Ignoring for the moment Python's bizarre syntax for joining lists...

aren't sets inherently UNORDERED? How can you "join" a set?

Supporting software in 2.4 format? (2, Interesting)

BestNicksRTaken (582194) | more than 9 years ago | (#10953880)

Now we just need to wait for 2.4 versions of py2exe, cx_Freeze3, wxPython 2.5.3.1, SPE, IDLE, PyQt, SWIG etc. before we can start using this!

I expect some software will even die now - like McMillan Installer, as development stopped on 2.3, unless 2.4-devel has some excellent backwards compatibility with 2.3 libraries.

I'm sticking to 2.3.4 for a good while yet, don't have a use for decorators.....

Good Stuff, but not enough to make me learn it yet (2, Insightful)

Onimaru (773331) | more than 9 years ago | (#10953881)

I've always liked Python, but I don't think this update is enough to make me learn it.

In one respect, it is exactly what I've been hoping for. No more sweeping changes or vast syntactic variances, but they have eliminated some usability problems and silly errors. It's a very mature language now, and seems to be behaving as such, this makes me happy

Still, though, they seem to be competing for a niche that Perl has a deathgrip on for me. I use Bash whenever I can, Perl when I can't or it would be ugly, and C when I feel like I haven't had my eyeballs gouged out with hot pokers enough lately -- er, I mean when performance is at a premium.

Python's capabilities seem to rapidly be approaching what I can do with C, and God knows I want to never malloc() again, but as long as compiled binaries can be made only "Not easily," I don't think it's going to unseat Perl for my heavy-duty scripting language slot.

lazy question (2, Interesting)

hey (83763) | more than 9 years ago | (#10953896)

Does it use that new Parot thingie that Python and Perl were supposed to share?

Also new in 2.4: WinSock 2 (0)

Anonymous Coward | more than 9 years ago | (#10953914)

Since Python first ran on Windows, it used WinSock 1.1. Starting with Python 2.4, the socket module uses WinSock 2.0. [sourceforge.net] . Most users probably won't notice the difference, but WinSock 2 is highly improved over 1.1 and offers many advanced features such as QoS.
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?