Slashdot Mirror


Learning Python, 4th Edition

thatpythonguy writes "Learning Python is a well-written book by an experienced Python trainer that has served the Python community well since the first edition was published in 1999. Now, at its fourth edition, this book by Mark Lutz arguably continues to be Python's bible." Read on for the rest of Ahmed's review. Learning Python, 4th Edition author Mark Lutz pages 1216 publisher O'Reilly Media rating 9/10 reviewer Ahmed Al-Saadi ISBN 0596158068 summary A hands-on book that will help you be productive with Python 3.0 quickly This book is addressed as an introductory text to programmers new to Python. Although people with no programming experience are not discouraged from reading it, they are warned that time is mostly spent teaching Python, not programming fundamentals. I agree with this picture, though from my own experience and those of others, the book is equally valuable to more experienced Python programmers both as a pseudo-reference and as an introduction to more advanced topics. The critical point here is that the book does not make assumptions about educational or vocational experiences and provides many examples; this renders the book approachable by a large audience.

Both Python 2.6 and 3.x are covered in this edition. However, the latest 3.x line is considered the reference from which variations in 2.6 are discussed when appropriate. This approach is logical; the new Python 3.x presents a major change to the language, but is not sufficiently dominant to warrant exclusive treatment.

This book discusses the Python language and excludes the Python standard and non-standard libraries. The latter are discussed in other places including Lutz's own Programming Python which stands at its third edition at the time of writing of this article. I find this division necessary because of size considerations and, in fact, this division did not exist in the first edition of the book! However, there is one topic that does not seem to fit the language/libraries divide, and that topic is packaging and deployment.

I will argue that there are not many (if any) books that discuss packaging and deployment of Python programs well. I will also argue that this topic should be included in the book being reviewed here since it is so essential to real Python programming. Since Lutz discusses the Python runtime environment, I do not think it detracts from the book's coherence to include a chapter on packaging.It is possible that the proliferation of various packaging and deployment options such as distutils, setuptools, pip, buildout, virtualenv, paver, fabric and others, is the reason for this exclusion. Or it could be that these tools are in a state of major flux that any text will become quickly outdated. If size is the reason for this exclusion, maybe Lutz or someone else can publish 'Packaing and Deploying Python' as a separate volume.

The book starts by building a case for the use of Python. Both the features of the language and its prominent users are discussed to build credibility. Then, the runtime environment is discussed: how to run programs in various ways on various operating systems and language interpreters.

Types and statements, which are at the core of any language, are discussed next. Notably, there is an excellent discussion of the topic of iterators and generators (also discussed in a later chapter). Functions, modules and classes are then introduced. The text also includes a discussion of general object-oriented programming (OOP) principles which I find to be invaluable as it brings the topic of classes to life.

Exceptions are introduced and discussed in detail. The placement here is appropriate since exceptions are now objects in Python so classes had to be discussed first. This chapter should prove to be especially useful for people migrating from other languages that do not have simple, yet effective, exception-handling constructs.

Finally, four advanced topics are covered: decorators, Unicode, managed attributes, meta-classes. I find the first two to be absolutely necessary for almost any system nowadays, even small ones! The atter two are not as ubiquitous, but should be useful to more experienced programmers.

I should mention here that the discussion of the topics discussed above does not stop at the basics but provides comprehensive coverage. This is evident in the discussion of concepts such as dynamic typing, inheritance order, iterators, generators, comprehensions, and functional programming, among many others. There is even an interlude on documentation and the pydoc library.

Like many programming texts, the book uses small programming examples (appropriately executed in the Python interactive shell). The small examples hope to capture the essence of the topic at hand, and that, it does well within the limitations of a small-scale context. But this fourth edition adds a new chapter on classes (Chapter 27) that contains a more realistic code example presented in a tutorial format.

In addition to examples, each chapter ends with a summary of the chapter's content as well as a quiz on that content. The quiz is immediately followed by its answers for easy reference. I have to admit that I do not use any of these two features, so I will not be able to comment on their efficacy.

Like many O'Reilly books, this is a well-written, coherent, and beautifully type-set book. I highly recommend it to anyone who wants to, or already does, program using python. It should help the novice in the transition to an excellent programming language or, otherwise, make an already familiar environment more powerful in the hands of veterans.

Ahmed Al-Saadi is a Software Analyst who works for a Montreal Python house. He wrote his first lines of code on a Sinclair ZX Spectrum+, though unfortunately not in Python at the time.

You can purchase Learning Python, 4th Edition from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

163 comments

  1. Aren't we all supposed to be switching to Lua now? by Anonymous Coward · · Score: 1, Funny

    Y'know. Just trying to keep up with the current trend.

     

  2. Cover art by Anonymous Coward · · Score: 2, Insightful

    Soooo the language is called PYTHON and O'Reilly put some kind of rodent on the cover? Not, I don't know... a python?

    Maybe if the rat was being eaten by a snake it would make sense...

    1. Re:Cover art by ultrabot · · Score: 5, Funny

      The rat is there because python is still learning.

      --
      Save your wrists today - switch to Dvorak
    2. Re:Cover art by DragonWriter · · Score: 2, Informative

      Soooo the language is called PYTHON and O'Reilly put some kind of rodent on the cover? Not, I don't know... a python?

      They put a different animal on the cover of each book.

      The python is, IIRC, on the cover of Programming Python.

    3. Re:Cover art by theskipper · · Score: 3, Informative

      A python appears on a previous O'Reilly book, "Python in a Nutshell" (ISBN 978-0-596-10046-9).

      My assumption is that they don't use the same animal on more than one cover, correct me if I'm wrong.

    4. Re:Cover art by K.+S.+Kyosuke · · Score: 2, Funny

      The rat is there because learning pythons need school supplies, too.

      --
      Ezekiel 23:20
    5. Re:Cover art by reverseengineer · · Score: 3, Funny

      Food for thought?

      --
      "FDA staff reviewers expressed concern about the number of patients who were left out of the study because they died."
    6. Re:Cover art by Ukab+the+Great · · Score: 1

      And then came the Python that ate the mouse that drank the Cocoa that sweetened Java that dissolved the Perl that replaced the Ruby that my father bought for zuzim.

    7. Re:Cover art by gpuk · · Score: 2, Informative

      IIRC, the python name is a homage to Monty Python and has nothing to do with the snake. Perhaps a knight sans arms would have been more fitting...

    8. Re:Cover art by mirix · · Score: 1

      Correct, but there is plenty of snake related imagery with python. I always get a kick out of the IDE named "Boa Constructor".

      --
      Sent from my PDP-11
    9. Re:Cover art by Anonymous Coward · · Score: 1, Funny

      A dead parrot!

    10. Re:Cover art by idontgno · · Score: 1

      I was about to mock you by pointing out the O'Reilly Perl libary is camel-centric, but looking at http://oreilly.com/pub/topic/perl, I am amazed at the zoo of critters in the Perl book list.

      What this tells me is that I need a much higher budget for books.

      --
      Welcome to the Panopticon. Used to be a prison, now it's your home.
    11. Re:Cover art by clampolo · · Score: 1

      Well, for Javascript they had a rhino. And then for Learning Javascript they had a baby rhino which I thought was pretty clever.

    12. Re:Cover art by Thantik · · Score: 1

      It's called "Learning Python: Powerful Object-Oriented Programming."

      Or for short: Learning Python: POOP.

      Maybe that's why the rodent is there.

    13. Re:Cover art by Hatta · · Score: 2, Funny

      This time they should have used a dead parrot. One with beautiful plumage.

      --
      Give me Classic Slashdot or give me death!
    14. Re:Cover art by Caesar+Tjalbo · · Score: 0

      It's a great book but it has just a naked python on the cover, they forgot the nutshell.

      --
      "I'm not much interested in interoperability. I want substitutability. I want to be able to throw your software out."
    15. Re:Cover art by cynyr · · Score: 1

      http://www.python.org/doc/faq/general/#why-is-it-called-python It's not named after that nasty snake thing. so no snake on the cover is good. :P

      --
      All of the above was encrypted with a Quad ROT-13 method. Unauthorized decryption is in violation of the DMCA.
    16. Re:Cover art by oldhack · · Score: 1

      And that is the book I'd (very highly) recommend for experienced programmers new to Python.

      --
      Fuck systemd. Fuck Redhat. Fuck Soylent, too. Wait, scratch the last one.
    17. Re:Cover art by Capsaicin · · Score: 1

      A python appears on a previous O'Reilly book, "Python in a Nutshell"

      If memory serves me correctly Learning Python was out in the 1st edition for some years before the Nutshell book was written.

      --
      Better to be despised for too anxious apprehensions, than ruined by too confident a security. --Edmund Burke
    18. Re:Cover art by Anonymous Coward · · Score: 0

      Hopefully at least one of them is an oyster.

    19. Re:Cover art by An+ominous+Cow+art · · Score: 1

      import parrots, fjords

      p = parrots.Parrot(parrots.NORWEGIAN|parrots.BLUE)

      for fjord in fjords.all():
          p.pine(fjord)

      Traceback (most recent call last):
        File "parrot.py", line 4, in <module>
          p.pine(fjord)
      AttributeError: 'ParrotType' object has shuffled off this mortal coil

    20. Re:Cover art by Anonymous Coward · · Score: 0

      A dead parrot!

      Please don't spam this thread!

    21. Re:Cover art by bennomatic · · Score: 1

      You may have been confused by the fact that there's a camel book and a llama book about perl. As far as I know, there's no dromedary book.

      --
      The CB App. What's your 20?
    22. Re:Cover art by bennomatic · · Score: 1

      Or, considering that the name of the language is actually a reference to Monty Python (Guido's a fan), they could use just about any animal from the MP lore. Of course, the only one I can think of is a dead parrot.

      --
      The CB App. What's your 20?
    23. Re:Cover art by Tumbleweed · · Score: 1

      Dude, you forgot your braces!

      Oh, right, Python...nevermind.

      Spam, spam, spam, braces and spam. Hold the braces.

    24. Re:Cover art by theskipper · · Score: 1

      Looks like your memory is serving you fine. The copyright page of my 2nd edition of Nutshell shows the first edition printing in March 2003. Amazon has comments dating to 2000 or earlier for "Learning Python".

    25. Re:Cover art by Switchback · · Score: 1

      ...or a swallow...but which one? An African or a European swallow?

    26. Re:Cover art by drinkypoo · · Score: 1

      They put a different animal on the cover of each book.

      The python is, IIRC, on the cover of Programming Python.

      There are over 20 species of python. Surely this is not the 27th book on Python...

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    27. Re:Cover art by ajlitt · · Score: 1

      And then came the C# of Death, which FUD'd the Python that ate the mouse...

    28. Re:Cover art by Jorgandar · · Score: 1

      Okay ill give this a try...

      import antigravity

      woah!! thanks python!

    29. Re:Cover art by plasticsquirrel · · Score: 1

      They use the same animal on more than one cover, if they are from different series. For example, their famous tarsier is used for both "Learning the vi Editor" and for "UNIX in a Nutshell." The python is used for three: "Programming Python", "Python in a Nutshell", and "Python Pocket Reference."

      The first edition of "Programming Python" (which uses the famous python image) was from 1996, and the first edition of "Learning Python" was in 1999. They are both from the same general series, so they couldn't use the same python image. My guess is that the mouse was used because pythons often eat mice, and a mouse is a small, timid animal (good for a beginner's book). Then an alligator was used for "Python Programming for Win32 Systems", which is no longer published today. So in the early years they had these three animals: the python, the mouse, and the alligator. Although many people would expect a continuation of snakes for these books, most O'Reilly titles only have animals tangentially related to their subject.

      Interestingly, it appears as though O'Reilly has found some extra boa constrictor and python images that they have used more recently in Python books.

      Sadly, "Learning Python" has grown from a book less than 400 pages, to one over 1200. It used to be that people would buy "Learning Python" if they wanted a reasonable sized learning book, and the big 1200 page "Programming Python" if they were truly crazy. Now "Programming Python" is over 1600 pages, and "Learning Python" is over 900. I wish they would enforce some editing decisions and call some difficult shots. Even a quota for how long a "Learning" book can be, would be very helpful. Nobody wants to sift through a 1200 page book just to learn a scripting language. :-(

      --
      Systemd: the PulseAudio of init systems
    30. Re:Cover art by laejoh · · Score: 1

      No arms?

      He's called the Black "Tis but a scratch; I've had worse!" Knight!

    31. Re:Cover art by Anonymous Coward · · Score: 0

      Obviously the one with the highest air speed velocity.

    32. Re:Cover art by mog007 · · Score: 1

      He's not dead, he's resting.

    33. Re:Cover art by DragonWriter · · Score: 1

      Sadly, "Learning Python" has grown from a book less than 400 pages, to one over 1200. It used to be that people would buy "Learning Python" if they wanted a reasonable sized learning book, and the big 1200 page "Programming Python" if they were truly crazy. Now "Programming Python" is over 1600 pages, and "Learning Python" is over 900.

      While 1216 pages is both "over 1200" pages and "over 900" pages, its kind of odd to refer to it as the former in one sentence and the latter in the next.

    34. Re:Cover art by plasticsquirrel · · Score: 1

      Yeah, I made that small mistake. I was incorrectly thinking of the third edition for one sentence, and then got the number correct for the next sentence about the fourth edition. :-P

      --
      Systemd: the PulseAudio of init systems
    35. Re:Cover art by firstalliancecu · · Score: 1

      I know an old lady - err,phython that swallowed a fly- err, rat...

  3. Monty by ulski · · Score: 5, Funny

    Woman: Well there's rat cake ... rat sorbet... rat pudding... or strawberry tart.
    Man: Strawberry tart?!
    Woman: Well it's got some rat in it.
    Man: How much?
    Woman: Three, rather a lot really.
    Man: ... well, I'll have a slice without so much rat in it.

    Why is there a rat on the cover of a snake book anyway? Perhaps O'Reilly already used a snake picture on the cover of some other book and they didn't wanted to confuse people by having 2 snake books?

    1. Re:Monty by bsDaemon · · Score: 2, Insightful

      IIRC, there is a python on the cover of 'Programming Python.' I don't know why they picked a mouse for this, maybe because it was less confusing than picking a second kind of snake? The cover of 'Programming Perl' is, famously, the camel, however the language isn't called camel, so when they put the llama, alpaca and vicuna on 'learning perl', 'intermediate perl', and 'mastering perl' respectively, it was obvious they were related but don't cause any clash due to naming. What does the sheep on 'Perl Cookbook' have to do with anything?

    2. Re:Monty by Anonymous Coward · · Score: 1, Funny

      A python would find a rat rather tasty.

    3. Re:Monty by Cryacin · · Score: 2, Insightful

      What does the sheep on 'Perl Cookbook' have to do with anything?

      Maybe mutton for dinner?!?

      --
      Science advances one funeral at a time- Max Planck
    4. Re:Monty by geekmansworld · · Score: 1

      Honestly, I puzzled over this very cover at the bookstore yesterday whilst picking up my copy of "Active Directory for Dummies".

      There are so many technologies that should lend themselves well to O'Reilly covers, yet don't (I also puzzled why the mySQL books didn't have dolphins on them).

      But Python not having a python? Well that's just silly...

    5. Re:Monty by jra · · Score: 1

      FWIW: the colophons generally (I'm tempted to say always) explain the theory behind which a given animal was picked for a cover.

    6. Re:Monty by Savage-Rabbit · · Score: 1

      What does the sheep on 'Perl Cookbook' have to do with anything?

      Maybe mutton for dinner?!

      Well, in that case let's hope they don't put a rat on the cover of the Python cookbook...

      --
      Only to idiots, are orders laws.
      -- Henning von Tresckow
    7. Re:Monty by thatpythonguy · · Score: 1

      Why is there a rat on the cover of a snake book anyway? Perhaps O'Reilly already used a snake picture on the cover of some other book and they didn't wanted to confuse people by having 2 snake books?

      Correct! O'Reily's Programming Python already has a snake! I suppose they decided to go with the snake's food.

    8. Re:Monty by Tumbleweed · · Score: 1

      It's a bit runny, sir.

      I don't care how fucking runny it is!

      Oh...the cat's eaten it, sir.

      Has he?

      She, sir.

      ---

      If ever an alien races comes to Earth and decides to destroy us for being uncivilized and uncultured, all we have to do to save ourselves is send them up the DVD sets of Python Python, Fawlty Towers and BlackAdder. And Manimal.

    9. Re:Monty by Anonymous Coward · · Score: 0

      I never got the pun "mutton/nuttin" until just now. Tolkien used it famously, but I'm sure it's much older than him.

  4. Re:So by stoolpigeon · · Score: 0, Flamebait

    you should call it a $la$hverti$ement. That would make you even more right.

    --
    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?
  5. Re:Aren't we all supposed to be switching to Lua n by Anonymous Coward · · Score: 1, Interesting

    Ruby failed to make a dent in Python popularity, despite the rails fad over the last few years. Lua isn't really a match for either python or ruby.

    Javascript may be the black horse here, because it serves an unique niche and is starting to get adoption outside that niche.

  6. Both of Alex Martelli's books are better IMHO by Anonymous Coward · · Score: 1

    Python in a Nutshell and Python Cookbook. Both discuss that deployment stuff, for example. Neither of them is geared towards complete beginners to programming though. They are very good if you're experienced with some other language and have picked up the basics of Python from the online tutorial.

    Learning Python is not a terrible book, but (except for the rather inconvenient matter of being about a pathological eclectic rubbish lister instead of being about Python) Learning Perl does a better job of accomplishing similar goals (explaining programming to non-programmers starting from scratch).

    1. Re:Both of Alex Martelli's books are better IMHO by roky99 · · Score: 1

      Python in a Nutshell ...

      This would be a great book were it not for the fact that it has just about the worst index I have seen in a technical book, let alone a reference book!

      I agree with you about Learning Perl vs. Learning Python. The former was a short, to the point, book that covered the basics, got me going with the language. From there I progressed to Programming Perl for the details, and the excellent Perl Cookbook for the how-to recipes. I have found the Python equivalents to be disappointing. I read an earlier edition of Learning Python but found it badly written and going into slightly bizarre amounts of detail at certain points but not explaining other things very well. I also have a newer edition that I picked up cheap but haven't read yet and it looks like it might be better but now seems to have got too big.

      It's strange really, as Python is so much cleaner than Perl so one might have expected that to make it easier to write books about it.

  7. JavaScript is the language of the day today. by Anonymous Coward · · Score: 1, Insightful

    Sadly, JavaScript seems to have become the fad language lately.

    A lot of people who can only handle front-end web development thought Ruby would let them do something a bit more serious, so it had a pretty large hype wave while they were trying it out. But they've found even it too difficult, so they've abandoned server-side work in favor of client-side coding again. Unfortunately, this has to be done in JavaScript, since that's basically the only language supported by all major browsers.

    It's a shame that we don't have Lua or Python in the browser instead of JavaScript. It'd make web development much more efficient. JavaScript is such a hack, and such a pathetic excuse for even a scripting language.

    1. Re:JavaScript is the language of the day today. by jra · · Score: 1

      Well, that depends on whether you consider "requires the user to install one plugin once, for every site" constitutes "in the browser", since I'm pretty sure that's the present state of affairs on Mozilla, at least. Whether there's a browser-side plugin for python on IE, I don't know; I avoid IE whenever possible. Since I'm the IT director, it's *always* possible. :-)

  8. Better Than First Edition? by adipocere · · Score: 4, Insightful

    I sincerely hope that this version is better than the first edition, although anything short of a random re-arrangement of pages would serve as an improvement. The first edition actually delayed my initial use of Python by about a year and a half. I had heard wonderful things about the language so I figured, "Ah, an O'Reilly book!" Big mistake.

    Endless bits about immutability, without hints as to why I ought to care. I can appreciate the use of the interactive prompt now, but to start with it seems ... strange. I was not transitioning to Python from shell programming, and I doubt many do. Lambda expressions, entirely too early. Not a great deal of attention paid to idiom, which is just about central to learning a new language. Little discussion of how you might have accomplished tasks in other languages and wish to do the Pythonic equivalent. I loathed the first edition and refer to it precisely never. I eventually dropped it in a puddle and felt no urgency towards retrieving it. The now-wrinkly cover suggests that some unhappy deity has attempted to purify it by flood.

    I ought to have tried fire.

    1. Re:Better Than First Edition? by gpuk · · Score: 1

      If not this book, care to share an alternative recommendation or two?

    2. Re:Better Than First Edition? by kpainter · · Score: 3, Informative
      Programming in Python 3: A Complete Introduction to the Python Language by Mark Summerfield is better IMHO.

      I gave up in the middle of Learning Python 3rd Ed. One of the things I absolutely hated about Learning Python is the author continually telling you about X will be covered later in chapter Y. There is a LOT of that. That and half-way through the book, I still couldn't do anything simple as he hadn't even talked about for loops yet. Too much detail on the finer points of data types and too little "quick start". I got bored with this book.

      I don't doubt that there is a lot of great info in that book. It just isn't organized very well at all. My guess is the 4th ed. is changed to reflect Python 3.x. If it were reorganized, it would probably be really good.

    3. Re:Better Than First Edition? by Monkey-Man2000 · · Score: 3, Insightful

      If not this book, care to share an alternative recommendation or two?

      Well, I can't disagree with the grandparent's very nice flame, but why not start with Guido's tutorial? http://docs.python.org/tutorial/ Between that and the library reference, I was up and running making useful scripts in an afternoon at work one day, but I had previous programming experience. But since this book isn't for people like that, who is it for? Only people I can think of are language lawyers, and there's a free source for that as well! http://docs.python.org/reference/index.html

      --
      This post was generated by a Cadre of Uber Monkeys for Monkey-Man2000 (603495).
    4. Re:Better Than First Edition? by slimjim8094 · · Score: 2, Informative

      I have probably the previous edition of this book, and what you're describing sounds like a different book. Lamda expressions came after basic and intermediate functions - I had no problem with it. All he talked about was idiom - the "pythonic" way of doing things - while mentioning that a C programmer would probably have used a loop instead of a map expression, etc.

      So I'd say they fixed it up a bit.

      --
      I have developed a truly marvelous proof of this comment, which this signature is too narrow to contain.
    5. Re:Better Than First Edition? by mindcorrosive · · Score: 2, Interesting

      Endless bits about immutability, without hints as to why I ought to care. I can appreciate the use of the interactive prompt now, but to start with it seems ... strange.

      The thing about mutability in Python is that it can bite you in the neck if you assume the variable passing and assignment work as in some other popular languages. I can appreciate the author's tirades about this, as he brought his point around, even with simple examples. And how do you propose to start with a language that doesn't have one-IDE-to-rule-them-all, like Visual Studio or Eclipse? You know how sparse is IDLE by today's standards.

      Little discussion of how you might have accomplished tasks in other languages and wish to do the Pythonic equivalent.

      That's why there's this other book, "Programming Python", again by Lutz, where he discusses the practical aspects of Python programming, and using the standard library modules. There are examples of the "Pythonic" way to do this or that, instead of masking C/C++ syntax with Python expressions. The discussions of modules, packages and classes is extensive, and down to the details of how they work and are used.

      I understand your frustration, and can't comment on the first edition that you've seen. I've preordered the fourth edition - this one - (the whole 1000 or so pages), and I found it a very good self-educational tool - I managed to learn most of the ins-and-outs of the language in just one week, without having prior exposure to Python (I've got experience with 3-4 other programming languages, admittedly). I'd recommend it highly for anyone that wants to learn Python (the language) quickly.

      Of course, this is my opinion, so take it as you may.

      --
      + 3.14 Transcendental
    6. Re:Better Than First Edition? by Monkey-Man2000 · · Score: 1

      Actually, I should have also recommended the Python Cookbook even though it's quite old and you can probably pick it up in a bargain bin (http://oreilly.com/catalog/9780596001674). It's kind of nice for the quick and dirty examples if you also refer to the language reference and tutorial to understand what the authors are doing. I.e., it's not a very good introduction to the language alone.

      But the best part is the strange looks you get from non-computer people when it's sitting on your shelf!

      --
      This post was generated by a Cadre of Uber Monkeys for Monkey-Man2000 (603495).
    7. Re:Better Than First Edition? by McNally · · Score: 1

      I'll chime in as another who found a previous edition of this work to be flawed -- enough so to tarnish the O'Reilly brand for me. While it's possible the newest edition is better it sounds (from the review) more like an update than a re-write.

    8. Re:Better Than First Edition? by steve.howard · · Score: 2, Informative
    9. Re:Better Than First Edition? by tepples · · Score: 1

      The thing about mutability in Python is that it can bite you in the neck if you assume the variable passing and assignment work as in some other popular languages.

      As I understand it, variable passing and assignment works in Python like it works in Java, or at least as it would if every variable in Java were of type java.lang.Object (with autoboxing of primitive types).

    10. Re:Better Than First Edition? by thetoadwarrior · · Score: 1

      Python Essential Reference is quite good, imo.

    11. Re:Better Than First Edition? by Anonymous Coward · · Score: 0

      A whole brand tarnished on one product out of hundreds (if not thousands)?! You're harsh man!

    12. Re:Better Than First Edition? by Anonymous Coward · · Score: 0

      I learned python from the pocket reference, also by Mark Lutz, and then went on to for more to docs.python.org. If you already know how to program in a language such as Perl, the pocket reference has all the information you need without any of the fluff.

    13. Re:Better Than First Edition? by Capsaicin · · Score: 1

      I sincerely hope that this version is better than the first edition, although anything short of a random re-arrangement of pages would serve as an improvement. The first edition actually delayed my initial use of Python by about a year and a half. I had heard wonderful things about the language so I figured, "Ah, an O'Reilly book!" Big mistake.

      That pretty much sums up my feelings towards Lutz' other ORA book Programming Pyhton. However, I have to say I found Learning Python quite serviceable (I learnt python). It had the virtue of being small enough to allow a programmer to pick the basics of the language up in a week, very much like Schwartz and Christiansen's Learning Perl.

      It only covered python 1.x though, and with 2.2 the language changed considerably (and much for the better imo). I looked at the 2nd edition and it was not only updated, but also expanded, making it less useful as a quick intro. I note the 4th edition is now 1216 pages up from the 1st editions ca. 350. So I don't imagine that has gotten any better.

      Endless bits about immutability, without hints as to why I ought to care

      Sorry?! In the 1st ed., mutability is mention about half a dozen times. Not enough imo given it's great gotcha potential. I'm wondering if were talking about the same book?

      I can appreciate the use of the interactive prompt now, but to start with it seems ... strange. I was not transitioning to Python from shell programming

      Yeah wouldn't it be great it the shell had an interactive prompt? :P

      Lambda expressions, entirely too early.

      Perhaps.

      Not a great deal of attention paid to idiom, which is just about central to learning a new language.

      I do have to agree with you there. Especially in a language where the community gets all fussy about what is and what is not "pythonic." Martelli's books do a much better job there.

      --
      Better to be despised for too anxious apprehensions, than ruined by too confident a security. --Edmund Burke
    14. Re:Better Than First Edition? by McNally · · Score: 2, Interesting

      A whole brand tarnished on one product out of hundreds (if not thousands)?! You're harsh man!

      Well, here's the thing. I spent most of the years of my career living in a university town with excellent booksellers. I now live in a comparatively tiny island community a long way from the nearest tech center and if I want tech books I can't just pop into a store that has them in stock and browse, I have to order them and have them shipped.

      I've previously bought quite a few O'Reilly titles and while not every one of them was brilliant, they were reliably pretty decent; this one was affirmatively the worst, to the point where in the future when I want a tutorial or reference work on a new technology I won't just call up and order the O'Reilly book on the subject because I don't feel like I can rely on their quality and I don't need any more $40 door stops.

      It doesn't mean I'll never order another O'Reilly tome, but it does mean that I felt let down enough to stop automatically trusting their quality by default.

    15. Re:Better Than First Edition? by Cycon · · Score: 1

      I sincerely hope that this version is better than the first edition, although anything short of a random re-arrangement of pages would serve as an improvement. The first edition actually delayed my initial use of Python by about a year and a half. I had heard wonderful things about the language so I figured, "Ah, an O'Reilly book!" Big mistake.

      Wow, I'm quite surprised actually, I had exactly the opposite experience with the first edition of "Learning Python."

      I distinctly remember picking up the book in '99, reading the first three chapters to get introduced to the language basics, then writing my first web-scraper to pull weather forecasts off weather.com and forward them as emails, arriving on my handset as an SMS message (AT&T was running a free email-to-SMS gateway at the time, and didn't charge to receive the messages). I think I skipped ahead to chapter 11 or so to find the code for reading html as text from a URL, as opposed to a local file.

      I had never written a tool which perform network lookups and was really impressed with the simplicity of the language and the book. The progression was from the very general to the very specific. The first three chapters were a history and basic introduction to the relatively unique concepts such as whitespace handling and how to deal with strings, as well as how Python handles common stuff like while and for loops. If I recall correctly it stepped into classes and objects after that, then proceed into specific libraries.

      I've been doing professional coding in Python ever since, and always recommend "Learning Python" as an introduction to newbies.

      My only disappointment in fact was that the size of the book has grown so much in the course of the last few editions.

      --
      Your Brain + EEG + LEGO Robots = Brainstorms
    16. Re:Better Than First Edition? by gpuk · · Score: 1

      Thanks for the tips guys. /wanders off to do some brisk trade with amazon...

  9. Which Python? by cephus · · Score: 1

    Yes, but where is the chapter on how to do the dead parrot sketch?

  10. easy to learn by Anonymous Coward · · Score: 0

    i learned python - look - heres how you say hello:"sssssssss" and goodbye "ssssss". snake talk is easy.

    1. Re:easy to learn by MaskedSlacker · · Score: 2, Funny

      Then how come only Harry can do it?

  11. First lesson by Anonymous Coward · · Score: 0

    This is a space:
    This is a tab:
    Learn to recognize them, you'll be using a language where they're semantic.

    1. Re:First lesson by Anonymous Coward · · Score: 0

      And this was reason enough for me not to touch Python. One of my more trying problems arose from a Makefile that was whitespace sensitive. It worked with or without the correct whitespace, just in different ways.

    2. Re:First lesson by Anonymous Coward · · Score: 0

      Python uses whitespace in a very sensible way. Perhaps if you'd bothered touching it you'd know that by now.

  12. Re:So by Anonymous Coward · · Score: 0

    Way to be a douchemonger. Like, seriously. You respond with a bunch of sarcasm THAT GETS NOWHERE FURTHER THAN THE GP and then use some tone to imply that you are God or something. Your post sickens me. Scum like you need to stop posting or be wiped out of the gene pool. Amen.

  13. Too wordy by milgr · · Score: 4, Informative

    I bought this book about a month ago. I had my doubts about a book this size, and my doubts were realized.

    I learned C from K&R first edition. K&R is about 150 pages (from memory). It covers all of the language succinctly and completely. Actually, it covers most of the language twice - first in tutorial form then in specification form. It is a fine resource.

    Why should a book on Python be over 1000 pages? I started reading this book the same way I read K&R - from the beginning. Unlike K&R, after 50 pages I barely got to coding. Within each section the language is quite verbose. I suspect that the authors were paid by the word or the page.

    On a positive note, I was able to use this book as a reference book as the index is quite reasonable.

    I would recommend this book to those insomniacs who are interested in learning Python.

    --
    Where law ends, tyranny begins -- William Pitt
    1. Re:Too wordy by mirix · · Score: 1

      The second K&R (with ANSI stuff added) Is close to 300 pages, IIRC.

      --
      Sent from my PDP-11
    2. Re:Too wordy by fredjh · · Score: 1

      It seems people have a great deal of problems documenting object oriented languages, IMO.

      The C book is simple and straightforward because C is simple and straightforward by comparison; you don't get lists and dictionaries and so forth in C.

      --
      Stupid, sexy Flanders.
    3. Re:Too wordy by stm2 · · Score: 1

      Maybe it is because Python has a large standard library (so called batteries included).
      Regarding paying per page, as a book author I can confirm that you are paid per page only if you accept to typeset the book (with LaTeX). That is a one time payment appart from royalties. If you don't typeset, you don't get paid by page, just have to follow the contract that says between xxx and xxx pages (where xxx are limits).

      --
      DNA in your Linux: DNALinux
    4. Re:Too wordy by Anonymous Coward · · Score: 0

      I would argue that the Python language and standard libraries ("batteries included") are at least 10x as big as C's. Also, Python is object-oriented /and/ functional programming paradigms covered in addition to C's procedural. (Sure, you can shim OO into C with libraries (Gobject, e.g.), but it's sure as hell not covered in K&R.)

    5. Re:Too wordy by jabuzz · · Score: 1

      The copy on my shelf says 272

    6. Re:Too wordy by Anonymous Coward · · Score: 0

      Beazley's book is the K&R equivalent for python. 197 pages of Python (Part A). There's a part B that is 400 pages of library reference. The library reference is longer because it goes far beyond what K&R covers for C.

    7. Re:Too wordy by yerM)M · · Score: 2, Insightful
      I'm being a bit tongue in cheek here, but maybe you are rather missing the point of Python which is "batteries included." The python standard library contains much more than Python, did K&R include:
      • A web server
      • An xml parser
      • Email parser
      • GUI package
      • Windows COM interface
      • And so on.

      It's kind of surprising that Learning python is only 1000 pages, which is not too say that it isn't too wordy.

    8. Re:Too wordy by Japher · · Score: 1

      It looks like most of the replies to this post talk about Python's large standard library (I think every one of them has used the phrase "batteries included") but quoting directly from the review:

      This book discusses the Python language and excludes the Python standard and non-standard libraries. The latter are discussed in other places including Lutz's own Programming Python which stands at its third edition at the time of writing of this article. I find this division necessary because of size considerations and, in fact, this division did not exist in the first edition of the book!

      This book attempts to introduce ONLY the core language so your comparison to K&R is dead on accurate. The author choose not to include the batteries in order to keep the book from getting too big, and he STILL took over 1000 pages. There's something wrong here.

    9. Re:Too wordy by xtracto · · Score: 1

      It looks like most of the replies to this post talk about Python's large standard library

      Yay! Slashdot implemented a Clippy!

      Let me try...

      Learn Python

      --
      Ubuntu is an African word meaning 'I can't configure Debian'
    10. Re:Too wordy by fredrik70 · · Score: 1

      believe that book is for ppl learning programming. the book you REALLY want is this one

      --
      if (!signature) { throw std::runtime_error("No sig!"); }
  14. You can script Windows & Linux with Javascript by Anonymous Coward · · Score: 0

    Phones too. Seems to be the "universal" scripting language.
     

  15. Missed out on Python by physburn · · Score: 1
    When learning languages i completely missed out on Python, i learn't perl and php, java and C and even Occam and Fortran. But no Python, are the any advantages to the snake named language?

    ---

    Python Programming Feed @ Feed Distiller

    1. Re:Missed out on Python by Just+Some+Guy · · Score: 1

      When learning languages i completely missed out on Python, i learn't perl and php

      ...having skipped right past English.

      --
      Dewey, what part of this looks like authorities should be involved?
    2. Re:Missed out on Python by navyjeff · · Score: 4, Informative

      I found Python to be a useful language for scripting and accessing C libraries.

      One of the things I like most about it (and others seem to hate) is that it's sensitive to whitespace. This feature has the side effect of making the language more readable and forcing people to indent their code. After programming in Perl, did you ever go back and try to figure out what you did a year ago? I find that my year-old Python programs to be much more readable than my year-old Perl.

      Also, if you're a scientist or engineer, I recommend "Python Scripting for Computational Science". It will get you programming much earlier than Learning Python and is oriented toward mathematical calculation and visualization problems.

    3. Re:Missed out on Python by Manhigh · · Score: 2, Informative

      While I cant speak to php or Occam...

      You aren't forced into object orient programming as with Java, although the language does have good implementations (IMHO) of classes if you choose to utilize them. It also doesn't force the 'one class per file' structure of Java upon you. (Granted its been years since I've touched Java, so these critiques may no longer apply).

      I started by using Python for a lot of the things for which I initially used Perl. I find Python code immensely more readable than Perl.

      Lately I've used Python alot because it has some superb 3rd party libraries for scientific computing (numpy, scipy, matplotlib are the three which I use the most.) These libraries give Python the utility of Matlab (vectorized functions, easy plotting, interfacing to C and Fortran for speed) in an open platform without the fees associated with Matlab.

      For my job (aerospace engineering) Python is now my go-to language when I first start working a problem, and I transition to C or Fortran only if I need the speed or someone else requires me to do so, which is not often these days.

      --
      "Open the pod by doors, Hal" > "I'm afraid I can't do that, Dave" sudo "Open the pod bay doors, Hal" > alright
    4. Re:Missed out on Python by jabuzz · · Score: 0

      Yes because no matter what language I use I write readable code - PERIOD. Readable code has nothing whatsoever to do with the language. I can write unreadable Perl and write readable Perl. I can write readable Python and unreadable Python. Well I could if I new Python :-)

    5. Re:Missed out on Python by Anonymous Coward · · Score: 0

      When learning languages i completely missed out on Python, i learn't perl and php, java and C and even Occam and Fortran. But no Python, are the any advantages to the snake named language?

      I just had a conversation with a guy I'm stuck working with on a project with. He was ready to consider using any language, as long as it was Python. It didn't seem to matter to him that it is totally unsuited for the task the client has in mind. Python isn't so much a language as it is a religion, kind of like Perl.

    6. Re:Missed out on Python by Anonymous Coward · · Score: 0

      Python is a fairly functional language, which is something you are missing in your repertoire. Lambdas and list comprehensions are very useful and interesting constructs that apply to certain kinds of problems a lot more readily than the declarative languages you might be used to, but they might require overcoming a learning curve. Python (and, similarly, Ruby) is a fairly shallow introduction to the otherwise fairly steep family of functional languages.

      It is often abused as a simpler Fortran or C, since it is very easy to do, so I would stay clear of that and try to stick to resources that teach you the common Python idioms.

    7. Re:Missed out on Python by navyjeff · · Score: 1

      Except that in Perl (and other languages), it's incredibly easy to write unreadable code. With Python, not so much.

      I've seen some code you've written, and I agree it's quite readable. You obviously spent some time keeping it clean and well-structured. One CAN always write readable code, but it is quite easy (and common) to use code kludges and make it hard to read in most languages. I've seen a few horrific Perl kludges, as well as a lot of improperly indented C, and ugly html. Maddening.

      The difference in Python is that it requires indentation, and most of the language is quite plain. Conversely, obfuscated code is difficult to write in Python. Try it sometime.

    8. Re:Missed out on Python by maxume · · Score: 1

      He is advertizerating his feed thingamajob.

      --
      Nerd rage is the funniest rage.
    9. Re:Missed out on Python by sqldr · · Score: 1

      Compared to C and C++, it's a different kettle of fish. If you're using C++ where you would normally use python, then you shouldn't be using C++. I guess the only crossover between the two is that python has some excellent libraries that allow you to get almost dirty with system functions, as well as things like opengl and audio libraries, so if you're tweaking filedescriptors or writing a game and don't need a compiled language, then I guess there is a little grey area. Incidentally, there's "weave" which allows you to embed c/c++ code into python and compile it on the fly, so you can get the best of both worlds in some cases.

      Compared to perl, I spend far less time looking in the python manual than I do in the perl manual when I'm using the same scripting language for the same task. Compared to perl's "there's more than one way to do it" motto, python has the philosophy of "there should be at least one obvious way to do it".

      With this in mind, you achieve the same tasks in a different manner. Perl's workhorse is its built-in regular expressions. Python has them, but you tend to use them as a last resort.. its splitting, joining, globbing and list comprehension features are more than sufficient for the same tasks, and look less like, well.. ~= /^[^(.*|)+?(xyzzy)/gS

      It also has more of a tendency to push you towards functional logic or use of iterators rather than getting bogged down with if/then/else type stuff.

      Finally (from me.. there's probably more, but I'll stop now :-)) it has proper classes with proper constructors, destructors, typed exception handling, inheritance, etc. without all of that "bless" nonsense. Yeah, you can do classes in perl, but it's so much hassle, people tend only to use it for libraries and bigger programs. You don't think twice about using a class in python where appropriate.

      Compared to java, although the syntax is a world apart, the grammar is actually very similar, and feature-for-feature, the language behaves in similar ways, except of course that java is a compiled language.

      As for fortran, I guess fortran is a bit specialised. Python has things like complex numbers, but they're worlds apart really.

      It took me about a day to learn python, and about 3 weeks to get confident with perl. The python language and library is designed by a quite slow moving, but very careful committee. Python has equivalents to CPAN, but CPAN is like doing a recursive wget on freshmeat and seeing what you get. The core library in python is so good and geared towards its users that you rarely (certainly as a sysadmin) have to bring in 3rd party modules except for specialist environments.

      --
      I wrote my first program at the age of six, and I still can't work out how this website works.
    10. Re:Missed out on Python by selven · · Score: 1

      You forgot the Python alternative to Mathematica

    11. Re:Missed out on Python by daver00 · · Score: 1

      That is true, but many languages carry with them a lot of housekeeping to get things done, Python tends to keep that sort of stuff out of the domain of the code. Consider a simple example, in C++ say we create a vector and iterate over its elements, we need to make the vector, an iterator, then invoke some pointer arithmetic to actually loop, and then dereference the iterator to extract data. But the important thing here is that we're iterating over items in a list (vector), however you end up with something like:

      vector<double> foo = bar;
      vector<double>::iterator iter = foo.begin();
      for(iter; iter != foo.end(); ++iter) {
          double thing = *iter;
          etc...
      }

      In Python this is simply:

      foo = [...]
      for (item in foo):
          thing = item

      You can set the C++ out as neatly as you want but the Python is inherently more readable because the housekeeping aspects are removed from the code. I don't care how much of a guru you are, to any human the Python example is infinitely more readable, and more of the code is devoted to describing exactly what is happening, rather than tangential intermediate steps. Yes this means you are trusting Python to do your housekeeping for you, and yes this means a performance hit, but this is besides the point, you shouldn't use Python in an setting where these things are important.

      This is not to rag on C++, I really like C++, but it silly to say that Python, probably the most readable language ever invented, is no more readable than any other language. And don't get me started on Java, but then I don't like Java at all.

    12. Re:Missed out on Python by mixmasta · · Score: 1

      Maybe, maybe not.

      The difference between the two is that many times to do a particular task in perl you will typically use various strings of punctuation characters, while in python you will use .replace() or other similar English names.

      The perl version may be shorter and more clever perhaps. But in a year, if you or the next guy don't have those punctuation combinations committed to high speed memory you'll be looking them up in a book or googling for them.

      Meanwhile the python script maintainer will recognize the operation immediately because they are mostly English rather than hieroglyphics.

      There are other levels of readability of course, but this one makes a difference.

      --
      #6495ED - cornflower blue
    13. Re:Missed out on Python by binary+paladin · · Score: 2, Interesting

      Disclaimer: I love Python.

      That said, I love Python IN SPITE of its way of enforcing white space. I've had many annoying debugging issues that are the result of whitespace being broken when moving from one editor to another and it makes using blocks inside the interactive shell more annoying than it needs to be.

      Most of my coding these days is in Ruby and while it doesn't enforce how you use whitespace, only a complete tool doesn't indent their code. I find that having some keyword or symbol (e.g. end or }) also makes code easier to read than just ending as a result of the indent dropping (which is not easy to see in some cases and is even more annoying if you have to use an editor without some way of visually denoting line breaks and tabs).

      The Zen of Python should be followed by virtually every language out there though. There isn't a language on the planet that wouldn't be more readable if those conventions were followed.

    14. Re:Missed out on Python by drinkypoo · · Score: 1

      After programming in Perl, did you ever go back and try to figure out what you did a year ago? I find that my year-old Python programs to be much more readable than my year-old Perl.

      Perhaps you should have left some useful comments. I comment the living shit out of my perl code, and therefore there is only dead shit in it, that which I wrote into it by accident. But seriously, I've gone back and reused perl code every time I could still find it when I thought I might need it. And really, I am not much of a programmer.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    15. Re:Missed out on Python by spitzak · · Score: 1

      Just to be fair, C++0x is adding support for exactly this example.

      There is a way to do the foreach but I don't know it. A more obvious thing is the ability to declare an auto variable as "auto a = foo()" and the compiler figures out the return type of foo() and makes a be that type, this gets rid of that ::iterator line which is by far the ugliest part.

    16. Re:Missed out on Python by daver00 · · Score: 1

      There is a standard for_each, but I think its cumbersome in its own way, and there is a foreach in boost. Heres the boost example code for iterating over a 2d vector:

      std::vector<std::vector<int> > matrix_int;
      BOOST_FOREACH( std::vector<int> & row, matrix_int ) {
          BOOST_FOREACH( int & i, row ) {
              ++i;
          }
      }

      Concise, but still somewhat obtuse. The python equiv is still much clearer in its intent, imo. You can just iterate over multidimensional lists in Python and they will be flattened. You can even use Numpy and use slicing syntax to perform the same ends:

      import numpy as np
       
      foo = np.array(...)
      foo += 1 # add 1 to every entry
      foo[1:] = 2 * foo[:-1] # Update every entry with 2* the previous entry

      Its not even that the iterator line is ugly, its the fact that you have to create one in the first place, and its a pointer. I like coding in C++, the output is solid and you feel like you've really achieved something proper, but it is inherently more verbose, obscure, and unreadable than Python.

      Python sacrifices a lot for readability, and it really is the most readable language out there.

    17. Re:Missed out on Python by Anonymous Coward · · Score: 0

      Try http://paste.pocoo.org/show/94512/ on for size!

      (Incidentally, I agree with the point I am presenting evidence against. Python's design and culture make writing and working with readable code much more easy and likely.)

    18. Re:Missed out on Python by not-my-real-name · · Score: 1

      After programming in Perl, did you ever go back and try to figure out what you did a year ago?

      I've gone back years later and figured out what I was doing with Perl code. If you write your code for legibility and remember that you shouldn't write code to the limit of your cleverness, you can do it too. Now, why I thought that it would be a good idea to write a combination text-based adventure game, symbolic math program is another question ;-)

      Sadly, many people seem to write code to show off how clever they are.

      I've also had experience deciphering obscure code -- a grading system for a school written in BASIC-PLUS with two character variable names and a 256 (or so) character line length limit. After doing this for a while, you begin to see the benefit of writing legible code.

      --
      un-ALTERED reproduction and dissimination of this IMPORTANT information is ENCOURAGED
    19. Re:Missed out on Python by Anonymous Coward · · Score: 0

      When I started out with Python, I hated the whole indent thing. Really really hated it. It didn't help that I was editing infoseek pages, which had the bright idea of embedding python into web pages then embedding javascript into that -- it was an insane time, the late 90's. But then I got used to it, liked it for a while and now ... frankly I don't notice it. It's probably one of the most superficial things about python. I find it about as readable as my java, and it's more the lack of sigils and use of high-level constructs like list comprehensions that really enhance the readability for me.

      There's a lot of things I still don't care for about the language, and plenty I can't stand about the culture (it's dominated by Twisted fanatics the way ruby channels are dominated by the Rails kids) ... but when it comes to the syntax, I don't have any complaints. You really do just get used to it.

  16. Re:why? by mangu · · Score: 3, Informative

    I know you are trolling, but here's the answer:

    1) Programming in Python is faster than in C, and Python lets you use C libraries where performance is needed. Python will not make C go away, but will let it be used where it's really needed.

    2) Python is more secure and much more powerful than PHP. With a programming environment like Django, Turbo Gears, or Zope, Python can easily do anything PHP can, but PHP is not even near to doing everything Python can do.

  17. Re:why? by Anonymous Coward · · Score: 0

    just like you said... where c is "really needed" it still must be used. whereas everything else php does in a much more flexible fashion. the flexibility is the root of all attacks on php because it allows morons to do things the wrong way if they choose. it also allows geniuses to implement procedural processes much more elegantly.

    python is pointless.

  18. Re:So by Anonymous Coward · · Score: 0

    So A asks a reasonable if cynical question about a practice that is commonplace today (sponsored reviews, astroturfing, etc), B mocks him while contributing nothing to the conversation, C decides to call bullshit on B, and now that qualifies C as having "implied his status as a deity" to paraphrase you. I'd ask you to back that up with some logic but we both know you can't.

    I sure wish you immature pantywaists would learn how to separate your bitchy, irritable, pathetic emotional reactions from reasonable behavior. And yeah, getting that pissy and wishing the death ("wiped out of the gene pool") of someone merely because he posts something you don't like qualifies as bitchy. Well actually I should not insult bitches like that. My bet? I think you're stoolpigeon and this time wanted to be a bitch without getting negative karma. In which case the post sickened you because it's true and you wish it weren't. Does it hurt, being not man enough to admit your post contributed nothing and instead trying to cover it up by wishing the death of a stranger?

    Ain't it funny how the one who gets so offended because he thinks someone pretends to be God is the same person who feels qualified to decide who should post, reproduce, or even live? Nah, nothing hypocritical about that. Oh i'm sorry, was that too sarcastic for you?

  19. And once your brain is fried from coding... by sootman · · Score: 1

    ... you can go here and start learning the other Python.

    "I came in here for an argument!"
    "Oh, oh, I'm sorry, this is abuse."

    You can see I've been studying. :-)

    --
    Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
  20. Pages? by jschmitz · · Score: 0

    Is this edition 500+ pages too? the last one is like a boat anchor.............

  21. JS vs. Lua by tepples · · Score: 2, Interesting

    JavaScript is such a hack, and such a pathetic excuse for even a scripting language.

    What makes JavaScript so much more of a hack than Lua? Both use prototype-based object systems. Perhaps your complaint is with the HTML DOM, but that would be the same whether you used Lua, Python, or JavaScript on top of it.

  22. Best book ever (for CS graduates) by stm2 · · Score: 1

    I liked this book (at least first ed., the one I read).
    This book made me love Python. But I found it too hard for my colleagues at work (most of them biologists who were never exposed to programming), so I decided to write my own book (tinyurl.com/biopython )
    I think "Learning Python" is a must have for the seasoned programmer who wants to learn Python.

    --
    DNA in your Linux: DNALinux
  23. That's not quite the python bible. by Anonymous Coward · · Score: 0

    This is. Don't confuse people. Its also not the idiot's guide, for dummies.

    I understand its a figure of speech, but its not a very good one and may confuse people with a different product.

  24. Re:So by Anonymous Coward · · Score: 0

    Meh, I was thinking the same thing myself, but I didn't want to waste the time replying. Here's a little article I found on people incessantly telling each other to die in a fire, etc. In other words, don't take it seriously. It was posted by some guy taking a smoke break and needed a little laugh. You're going to get a heart attack from the stress inflicted upon you by people telling mild jokes. Take a chill pill and relax.

  25. Re:why? by daver00 · · Score: 1

    "...everything else php does in a much more flexible fashion...."

    "...it also allows geniuses to implement procedural processes much more elegantly."

    Let me guess, you are 15?

  26. Question: Who's making a living coding Python? by gestalt_n_pepper · · Score: 1

    I mean, exclusively coding in Python? Who's got a paying job? Just curious.

    --
    Please do not read this sig. Thank you.
    1. Re:Question: Who's making a living coding Python? by Ogi_UnixNut · · Score: 1

      I had a job doing python development for a media company. Mostly for internal/backend systems. Did it for years, but the recession resulted in my unemployment. I have since found 5 other jobs who want python dev's, so there seems to be demand, and demand seems to be increasing as time goes on.

    2. Re:Question: Who's making a living coding Python? by gestalt_n_pepper · · Score: 1

      Interesting. Was it ILM? I know they've used Python forever.

      --
      Please do not read this sig. Thank you.
    3. Re:Question: Who's making a living coding Python? by Anonymous Coward · · Score: 0

      Me. I got the job as a graduate, got trained in Python and after using it quite some time you realise that what looks like a bit of a simple language really does have lot of depth. It's just a shame that most people who criticise it have never bothered really learning it.

      I use other languages in my spare time (it doesn't seem like a good idea to become a one trick pony) but at work it's all about Python.

    4. Re:Question: Who's making a living coding Python? by An+ominous+Cow+art · · Score: 1

      I am not exclusively coding in Python, but I do as much in it as I can. Probably about 80% Python and 20% Visual FoxPro, these days.

    5. Re:Question: Who's making a living coding Python? by thatpythonguy · · Score: 2, Interesting

      I (the author of this review) use Python exclusively (if you don't count specialized and supporting languages). If you are looking for high-profile users, try Google. Python is one of three "officially supported languages" (the others being C++ and Java; "official" does not mean that other languages are not used!). I would guess that all other large software houses use Python somehow. Besides being a great language in its own right, it is a great systems/prototyping language! Also, it is perfect if you like to code without undue pain ;)

    6. Re:Question: Who's making a living coding Python? by fredrik70 · · Score: 1
      --
      if (!signature) { throw std::runtime_error("No sig!"); }
    7. Re:Question: Who's making a living coding Python? by spiralx · · Score: 1

      My first programming job was 100% Python, writing custom modules for print estimation for clients. My current job I'm doing Python 50% of the time writing plugins for our XML editor. Which is two jobs out of five.

  27. beautifully type-set book? by larry+bagina · · Score: 1

    I'm calling bull shit on that one.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

    1. Re:beautifully type-set book? by thatpythonguy · · Score: 1

      Maybe I need to clarify the meaning of beauty here. It is not that the book is elaborate in its ornamentation. It's the beauty that stems from clarity. I find O'Reilly books to be the most readable due to their clear typesetting, so to speak. Furthermore, beauty is subjective to an extent that it is hard to call someone on his aesthetic preferences in the same way you can call him on facts.

  28. Re:why? by Anonymous Coward · · Score: 0

    I am 7. And I will have your job when I am 15.

  29. Wear gloves. by NeoSkandranon · · Score: 3, Funny

    Carpet pythons, like I own, are bitey bastards. I hope whatever python you learn about in this book is a little more friendly.

    --
    If you can't see the value in jet powered ants you should turn in your nerd card. - Dunbal (464142)
  30. The Bible? Bad Analogy... by happy_place · · Score: 2, Interesting

    O'Reilly "Learning X" (fill in X with your programming language of choice) are not "BIBLE"s. They're learning texts. For the real meat of the language, decent reference and altogether comprehensive understanding of life and the universe, you'd want to pick up O'Reilly "Programming X" books. So in this case, Programming Python would be a Bible, a book you return to again and again. The Programming series of books, for most experienced programmers is generally just as good a place to start learning the language, and you don't need the Learning series.

    --
    http://www.beanleafpress.com
  31. Re:why? by Anonymous Coward · · Score: 0

    You've convinced me. The world only needs two programming languages, and by miraculous coincidence, those two just happen to be The Pair, and anything other than those two is totally superfluous.

    There. That's what you wanted to hear, right?

  32. Maybe Hulk Hogan's biceps... by Anonymous Coward · · Score: 0

    ...would have been a better cover art image?

  33. Re:why? by Anonymous Coward · · Score: 0

    well... if you're saying that python is good because it can use c libraries, but c is still required for some things, then that doesn't really matter... c can still use c libraries, and is better at doing it, and you can't not use c.

    so "python is better because it's faster to code than c"... first off i don't believe that, but even if it were true, i can confidently say that it's faster to code in php than ANYTHING. if you don't need classes or types or constructor functions or static main voids you don't use them. you just alter the data you need to alter. nothing else. so if you want fast coding you have php.

    if you think python is the answer, you are kidding yourself.

  34. Mixing 2.6 and 3.0 by JohnM4 · · Score: 1

    I'm not sure it's worth it to mix Python 2.6 and 3.0 in the same book. Of course there's always the possibility that you will inherit some code from either version, but in the course of learning the language I think it's best to pick one path and stick with it. I teach introductory programming with Python and we have stuck with 2.6 at least until most resources catch up to the 3.0 changes.

  35. Re:why? by aztracker1 · · Score: 1

    Computer language wars have existed since COBOL, it's a matter of personal preference as much as anything. For the most part run-time interpreted languages do the job, which allows for a near infinite number of languages to proliferate. It's pretty simple, some people prefer the flexibility of Perl, some want a bit more from that, then we get Ruby. You have C which begat C++ and Obj-C which cross-breeded and spawned Java and C#. Not even to get into functional derivatives, or prototypal languages.

    The only moron here seems to be the one supporting PHP as a better alternative to anything. PHP's implementation is inconsistent at best, and irritatingly obtuse at worst. It does nothing to bring libraries into language constructs, and doesn't even attempt to have any consistency in its' own methodology. It is/was and shall continue to be an ad-hok wrapper around a few C based primitives.

    --
    Michael J. Ryan - tracker1.info
  36. Re:Aren't we all supposed to be switching to Lua n by Tumbleweed · · Score: 1

    Screw that - go with D. Performance *and* syntactical sugar. Two great tastes that taste great together.

  37. Re:why? by daver00 · · Score: 1

    Exactly how much productive work have you done in Python? Because if you think anyone can output code faster in C than Python, you kind of sound like you've never used python.

    "if you think python is the answer, you are kidding yourself."

    You'd better tell Google that, maybe they'll start porting all their Python over to PHP?

  38. Re:So by stoolpigeon · · Score: 1

    There's no issue to address when dealing with a troll.

    A good example is the fact that the sentence above is wasted on you.

    --
    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?
  39. I used the first edition but have Beazley now by Strange+Attractor · · Score: 1

    I learned python out of the first edition of Lutz and Ascher. I just pulled out my copy for the first time in years. The last page number is 366. I use Beazley's "Python Essential Reference" almost daily. Not having taught python and not having learned it twice from two books, I don't have much to say about what would be a better introduction. I recommend python the language and Beazley's book. I never found Lutz and Ascher's book (first edition) useful as a reference.

  40. Just wanted to add... by binary+paladin · · Score: 1

    I read the 3rd edition when I first started messing with Python and it's a GREAT book.

    In fact, if I was teaching kids to program, this book would be my starting place. It's well written, easy to understand and just a good general introduction to programming in general.

  41. Python Programming: An Introduction to Comp Sci by darpo · · Score: 1

    For those reading the criticisms of this book and looking for an alternative... I have been working my way through this book. It is excellent. It's the book I wished I'd had when I tried CS years ago:

    http://www.amazon.com/Python-Programming-Introduction-Computer-Science/dp/1887902996

  42. Re:Aren't we all supposed to be switching to Lua n by dimeglio · · Score: 1

    It is very interesting to see the interest and trends based on book sale volume. The state of the computer book contains this interesting chart. For more details see O'Reilley Radar. This was published mid-year 2009. Maybe this new edition might tip the scale.

    Since MS is putting all their eggs in c# (and c,c++) it isn't surprising to see the interest. Of note, the impressive rise in Actionscript likely due to web based animated ads.

    --
    Views expressed do not necessarily reflect those of the author.
  43. Re:Aren't we all supposed to be switching to Lua n by dimeglio · · Score: 1

    Of course, I forgot to mention the sudden interest in objective-c thanks to Apple.

    --
    Views expressed do not necessarily reflect those of the author.
  44. Re:why? by Michael+Kristopeit · · Score: 1

    why should a language do anything to bring libraries into language constructs other than allowing for user defined namespaces, classes, and methods? you want to overload math operators some more? they don't "attempt" to have "any" consistency?? "ANY"? i see lots of consistency... did they not attempt to do that?

  45. Re:why? by aztracker1 · · Score: 1

    By consistency I mean in terms of naming, and parameter conventions. Having all extensions as top-level functions is BS to begin with. I really don't need to elaborate on this, if you google for: Why PHP Sucks you will get far better worded reasoning than I will give in this ./ comment.

    As to bringing libraries into a language's semantics, it is to provide a better developer experience. There are many cases were a given underlying system interface is exposed in a platform/language specific way. PHP's extensions and even language features are horribly inconsistent as they are.

    I will say there are a handful of nice frameworks that will work within PHP, that doesn't mean the core of PHP doesn't have its' own issues.

    --
    Michael J. Ryan - tracker1.info
  46. Re:why? by dimeglio · · Score: 1

    I was formally trained using assembly language. My first high-level language was Basic Plus (DEC). So Perl is just too sexy for me. I can't help using it. Statements like:

    open my $file, "name" or die "Error";
    or
    print $the_report_line unless $no_space_on_page;

    Are great!

    It is the only language so far which I'm able to write small scripts with no syntax errors.

    --
    Views expressed do not necessarily reflect those of the author.
  47. Re:Aren't we all supposed to be switching to Lua n by jo42 · · Score: 1

    You mean the iPhone. Without it there would be no spike in interest in Obj-C.

  48. Python Essential Reference by Mike610544 · · Score: 1

    I had the first edition of the Learning Python book and didn't find it that useful. The old 1.5 version of Python Essential Reference was way better. Even being new to programming, I found it very readable. I expect the new versions are just as good. It's clear and concise; the chapter on classes is 6 pages, but taught me everything I needed to know. It's one of the few dead tree resources that I still refer to. From total noob to 10 year veteran that book's served me well.

    --
    ... also, I can kill you with my brain.
  49. And by mahadiga · · Score: 1

    A Byte of Python is also a good download-ablebook.

    --
    I'd like to buy homeland for our 10 million people. http://twitter.com/mahadiga
  50. Re:So by WalesAlex · · Score: 0

    and there i was, thinking the last bit of sense had dripped out of the interwebs, good post! :) i do see dangers in separating emotion from reason though, sure it leads to problems with emotionally scarred people but too much reason and this place would be about as fun as the contents of my sink

  51. OT - Re:Wear gloves. by fredrik70 · · Score: 1

    always likes snakes, just out of interest, how much force is there in a bite from one?

    --
    if (!signature) { throw std::runtime_error("No sig!"); }
    1. Re:OT - Re:Wear gloves. by NeoSkandranon · · Score: 1

      That varies a lot with the snake, and what type of prey they are adapted for. I don't know that there exists any physical measurements of bite pressure, so understand this is my perspective having been bitten by a number of different species:
       
      Common North American constrictors such as black ratsnakes or kingsnakes have a relatively mild bite, but an arboreal python for example (such as my carpet python, or the green tree python) has pretty developed jaw muscles to avoid dropping prey items in the swallowing process (And incidentally have longer teeth for the same purpose.)

      --
      If you can't see the value in jet powered ants you should turn in your nerd card. - Dunbal (464142)
  52. The definitive Python Book by fartrader · · Score: 1

    Lutz rocks the house. I would have given it a 10.

  53. Re:So by xOneca · · Score: 1

    Where can the book be downloaded?

  54. Best Python book for n00bs: by Anonymous Coward · · Score: 0

    Dawson, M. “Python Programming for the absolute beginner” 2nd edition. ISBN 1-59863-112-8

    Note I said n00bs.

    No, I don't get paid to say this.