Python 2.3 Final Released
An anonymous reader writes "Nineteen months in the making, Python 2.3 has just been released. With a plethora of changes since version 2.2, this release is definately worth the upgrade. Be sure to read the Release Notes and the Highlights file for more information."
I wonder what this means to the people at blender who just updated the python API
> "I allege that SCO is full of it" -Linus
What did it help you do? Work on your reading skills? Start your camp fire? Reach the top shelf?
How did it help you? Did you really need help? If so was this book uniquely helpful or do you think others would have helped too?
Are there other reasons why it was great? Was the author witty and entertaining? Or was he dry and to the point? Was his writing unusually clear and illuminating? Did he "speak to you"?
I'm not saying every comment here has to be a full book review, just that yours was devoid of any helpful content.
At the top of the list of new features they have sets. The first paragraph says that sets are implemented by hashtables. I wonder whether it is really meaningless from the "practical" point of view to implement sets with data structures like red-black trees or Fibonacci heaps. The advantage of the latter over hashtables is a solid bound on the worst case running times.
for the same reason that a perl hacker will get a reasonably complex task done upwards of 100x or 1000x faster than an assembly programmer.
At one time people were really concerned with the whitespace situation in Python. While both sides made good arguments for and against having whitespace be syntactically important, it all boiled down to van Rossum's decision to make it so.
Then came the trolls. Lots of them. They saw that there could be bites to be had by just dangling the topic of whitespace out there. People were very willing to bite on the old arguments, but nothing was ever decided because all the arguments were just rehashes and the "experts" still saw mandatory whitespace as a crutch for stupid programmers, and Python "experts" said it helped them see where their blocks were. It didn't matter a whit, Guido went his own way.
But now, time has passed and Python's reliance on code beautifiers just to run has shown itself to be not quite the boon that it once purported to be. Yet Python enthusiasts still cling to the idea that whitespace ought to be syntactically relevant. So out come the old arguments, only this time the anti-whitespace crowd has more ammunition and the pro-whitespace gang is running out of bullets. But Guido goes his own way.
At some point the Python project will need to fork to release it from this whitespace requirement. In this day and age, only beginning programmers need such a visual crutch. Python has shown itself to be useful beyond Hello Worlds and Good Morning %s! It is time for the language to grow up. Too bad Guido still goes his own way.
It could be worse, people could be learning Basic instead of Pascal and Java. At least they are slightly similar to C. I start programming with Basic and it's haunted me ever since.
Most of your problems would be fixed with a good python-aware editor.
:-)
Putting a large block of code into a while or for loop.
Well, if you had a large block of code to insert, why not make it a function and call it. Also, when you're working with Python, you quickly learn (or assign) the "entab" and "detab" commands, so inserting the tabs aren't a problem.
TABS and order of whitespace
Most people have their editors convert tabs to spaces
For decently-complex programs there might be so many nesting levels that the indented code is spaced so far inwards that one needs ridiculously-wide displays for sanity.
Someone who is using 10 levels of nested blocks isn't effectively refactoring. Extract method now and then...
My father is a blogger.
The only point of your post was to get your nice referral bonus for all the Slashdotters clicking through to Amazon.
Moderators should know to look out for this... it's way worse than karma whoring. Did you even read this book? I wouldn't be wondering this if your post wasn't so clearly a cash grab.
If so, it might help if you wrote something useful about why you're recommending it! (And I don't mean cut-n-paste from an Amazon review either...)
Out by an order of magnitude, and not getting closer any time soon. Last I checked, it's out by a factor of 100 or so for small operations (loops, etc)
Well, regular Python code can see some dramatic speedups, with just a little bit of extra work. Check out Psyco if you firmly believe that interpreted languages will never ever be as fast as C.
With sufficient cleverness, it may be possible to boost Python beyond the speed of the most highly optimized pre-compiled program.
Psyco and approaches like it do have drawbacks, but there is some very interesting work going on now with high-level languages.
easy solution.
while something someval: #{
do.something()
while x 10: #{
print x
#}
#}
TODO: Something witty here...
Everything I've read that came out of Dijkstra's mouth or pen reminds me of my English grad school days.
"Your undergrad professors taught Hemingway/Joyce/Fitzgerald/Some other author we don't like? You have a lot to unlearn before you can even grovel at our feet. Your mind is tainted."
Typical ivory tower bullshit. Granted, some teaching methods and ideological positions lend themselves to learning better than others, but this is typical academic posturing.
Sorry for the diatribe, but this is what's wrong with American education at all levels. You don't get promoted and you don't get tenure by defending the status quo, no matter how effective it is. You get attention by pushing a platform that is different and strident. It doesn't matter if you're right or not because the administration only cares about the bottom line (grants, enrollment, university prestige). If your college of whatever attacks the other university's college of whatever, you have the upper hand.
This, of course, plays right into the hands of the majority of professors who are pompous windbags, whose chief pleasure in life is fucking TAs and putting down the frosh to make themselves look smart.
Take the word of academics with a grain of salt. They have agendas too. For that matter, take all authority with a grain of salt. Use authority as a starting point if you must, but approach it with scepticism and develop your own opinions. If somebody tells you goto is harmfull, try it out. If it works for you, use it. In the case of goto, you'll probably find that it is harmful. But if you find the answer yourself, you've learned more than the answer. You've learned more than how to pass the exam.
This is a common saying when you talk with Python/Java programers. Plus, with something like wxPython, you can have a slick client application to boot.
Last time I saw unbiased performance comparisions, the difference between Python and Java wasn't really worth talking about.
No, Python is not a competitor for Java. The reason why is because Python does not have a monstrous, hulking corporation shoving it down peoples throats. Python does get close to Java performance for a number of things, and for those which it doesn't it is easy to incorporate C or C++ code into it(remember the 80-20 rule here). I'm really starting to think that the whole static type checking as a requirement for large systems thing is just dogma.
The first is NetLogo because its really awesome and you can do great things with it very easily. Ever try to simulate the spread of diseases in a C program??? The second is Dr Scheme which is a newer form of LISP. Teaches kids how to use functions and recursion. And the tortures of syntax. I just love () now. Rather i love (((()))) now. That portion of the course is concluded by us making our own number system with simple arithmetic functions. I think we used A's to represent a unit. Finally we conclude with Python. Basically it teaches us how to use a liner programming language.(none of the others really read top to bottom.) Overall a very good course. They also teach an introductory course that spends a whole term on python. Python has everything the more advanced languages have and its free in everyway. Plus it is much easier to read and teach with. I love it as does everyone who takes the course.
Compiling alone wouldn't bridge the gap. Python already reduces interpreter overhead by using a pre-compiled byte-code. A large part of the problem is in dynamic typing: for example, when you say
a+b
in python, it's not equivalent to doing the same in C++. In python, you need to do a runtime type check and then decide what operation to perform, and only then can you add a and b. In C++, the dispatch can be performed compile-time.
What you really need to get a big speedup is some sort of mechanism that can eliminate a lot of this type checking (the other guy posted a link to an interesting approach to this problem)
But I've often been impressed with the ease of coding in such a language
It's a bit of a two-edged sort for the same reason -- the lack of type checking makes it easy to write code quickly, but it also makes it easy to code incorrectly.
Yes, you too can use a half-baked lisp without admitting to yourself, with the new improved Python 2.3!
Remember, Greenspun's 10th is not just a rule, it's the LAW!
What's wrong with it is that it's the syntax for dictionaries. Similar to hashes in Perl, it is a built-in type for Python. Anything wrapped in {} would probably be viewed as an attempt to make a dictionary by the parser.
I've discussed this with all my software engineering colleagues, and most of them have white space as their only hang up about the language. I thought this was pretty petty at first, given the other strengths of the language, but one person brought up an extremely good point. A co-worker at his company is blind. He said that having to deal with white space while coding was near impossible (maybe he uses a "pretty printer" or code beautifier after the fact? I don't know) Has anybody on
I do think it would be nice if there was a way to open and close a block (someone later down in the comments suggested preprocessor comments of and ) such that one could use either method. Perhaps there would even be a built in function of the interpreter to spit out the code one way or the other.
I must say I've gotten used to the whitespace over the past year. Using a decent editor makes life much easier in this respect. I would encourage anyone who hasn't tried out Python for this reason alone to give it a shot for a few weeks and see what you think.