Truck Month Summer Reading Amazon Fashion Learn more nav_sap_plcc_ascpsc Mudcrutch Father's Day Gift Guide 2016 Fire TV Stick Get Ready for Summer and Save 15% The Baby Store Find the Best Purina Pro Plan for Your Pet Amazon Cash Back Offer DrThorne DrThorne DrThorne  Amazon Echo  Echo Dot  Amazon Tap  Echo Dot  Amazon Tap  Amazon Echo Starting at $149.99 All-New Kindle Oasis AutoRip in CDs & Vinyl Outdoor Recreation

Customer Reviews

4.5 out of 5 stars28
Your rating(Clear)Rate this item

There was a problem filtering reviews right now. Please try again later.

on March 8, 2004
This is a great book, without question. The question is whether it is worth the price, given the free online HTML reference documentation.

+ Very good index; somewhat better than the online index.
+ Helpful explanations.
+ Some examples.
+ Much more advice than the online docs.
+ Very nice typesetting.

Cons (1st edition):
- Does not cover some of the most useful (new) modules: timeit, logging, zipimport, itertools, sets, sum, heapq.
- In particular, I would love to have ADVICE on how to use logging effectively.
- DOES cover the dead (insecure) modules rexec and Bastion.

So take your own decision. Personally, I would say it's not essential, but still worth the price. I go back and forth between the online index and this book.


The 2nd edition covers most of Python2.5. (The 1st covered 2.2 and much of 2.3). It includes most useful modules and excludes the deprecated ones, so it actually adds much more info than its slight increase in page-count would indicate. The only thing I was not able to find was 'meta_path', which is at least mentioned as highly technical.

In general, the 2nd edition is for a more expert user than the 1st. The explanations sometimes include some dense code:

* There is a long example of using meta-classes.
* The explanation of the new try/except/finally assumes that you understand the old (broken) behavior.
* The 'with' statement is explained by way of an equivalent fragment of code.

These changes make the 2nd edition ideal for the practicing Python programmer. However, a novice might be intimidated.

I would now increase the rating to 5 stars if I could. Excellent reference work!
22 comments|101 people found this helpful. Was this review helpful to you?YesNoReport abuse
on April 16, 2003
Python in a Nutshell, by Alex Martelli, 2003 O'Reilly, 636 pages.
Perhaps the best book about Python ever written, this book is the perfect capstone to anyone's library of Pythonic books, and also the perfect introduction to Python for anyone well versed in other programming languages. For newbies to programming, this would still be a good second book after a good introductory book on Python, such as Learning Python by Mark Lutz.
Written by my favorite author and Pythonista, Alex Martelli, this book manages to fill three roles in extremely pleasing fashion. First and foremost to me, it is a great read, straight through. Mr. Martelli's prose is always sparkling and always keeps the reader interested. No matter how many Python books you have read, you will learn some nuances from this book, and it is about the best review of the whole Pythonic subject matter that I can imagine. While there is absolutely no fluff whatsoever in these 636 pages, it still makes for rather easy reading because the explanations are so clearly thought out and explored as to lead one gently to understanding, without in any way being verbose. It is obvious that Alex Martelli took his time and put in sufficient thought, effort, and intellectual elbow-grease to make this work a classic for all time.
Secondly, this book is the ultimate Pythonic reference book, the best fit to this role I have yet seen. You will keep this book in the most cherished spot on your book shelf, or else right at your side on your computer desk, because you can almost instantly find any topic on which you need to brush up, in the midst of a programminng project.
Third, Python in a Nutshell is the most up-to-date book on Python (as of April 2003) and includes the best and most complete expositions yet on the new features introduced in Python 2.2 and 2.3. These topics are not only covered in depth, they are integrated into the text in their proper positions and relationships to the language as a whole. They are explained better here than I have seen anywhere else, so much so as to make them not only understandable to me (a duffer), but indeed so that they appear seamlessly Pythonic, as if they had been a part of the language since version 1.0. Topics explored in depth include new style classes, static methods, class methods, nested scopes, iterators, generators, and new style division. List comprehensions are made not only comprehesible but indeed intuitive.
The book is surprisingly complete. It covers the core language as well as the most popular libraries and extension modules. It is difficult to choose any one portion of the book to highlight for extra praise, as all topics are treated so well. It is a complete book, the new definitive book about Python.
Everything about this book speaks of quality. In addition to the top notch writing and editing, O'Reilly really did the right thing and published this book printed on the highest quality paper, paper so thin that the 636 pages are encompassed in a book much thinner than one would expect for such a size, but strong enough to resist wear and tear. The text is most pleasing to the eye. Holding the book, and turning its pages, gives one a feeling of satisfaction.
Any job worth doing is worth doing well. Alex Martelli and O'Reilly have done justice to a topic dear to our hearts, the Python programming language. Perhaps, in years to come, the passing time may make this book be no longer the most up-to-date reference on the newest features added to Python. But time can not erase the quality craftsmanship and the shear joy of reading such a well thought out masterpiece of Pythonic literature.
Ron Stephens
0Comment|59 people found this helpful. Was this review helpful to you?YesNoReport abuse
on May 1, 2003
I bought this book at the PyCon 2003 Python conference mainly to complete my Python book collection. I thought that since it was a Nutshell book and I already knew a ton about Python (I am an official developer on the language) that I wouldn't really pick up that much.
I was wrong. Not only did I learn some new things, but Alex's wonderful way of presenting ideas helped clarify and present a different view of some vital concepts in Python that made them even easier to grasp than I had originally thought. There is a reason why he is called the Martellibot on comp.lang.python and the python-dev mailing list.
I also have a friend who is a programmer who has read the first chapter or so of the book and has also found it a great way to learn Python.
So whether you are a hardened Python programmer or just starting out (as long as you can already program), this book is definitely worth the money. And the Python Cookbook makes a great companion book to this to pick up a few tricks and get even more example code to learn from (especially from my contributed recipes to the book =).
0Comment|27 people found this helpful. Was this review helpful to you?YesNoReport abuse
on January 17, 2004
Let me begin this review with a fair warning: this book is NOT for fresh programmers, hobbyists, system admins and other non-professional programmers out there, looking for a book that will actually help them LEARN Python language (even if the book has 4+ stars, it's still the O'Reilly Nutshell book).
(Btw. I know that, because I fit in all previously mentioned categories :-).
This book is (as title suggest) a QUICK reference of the Python language written by very competent author, I have no second thought about that, for already competent Python programmers that need good reference manual at hand.
I dare to say, that terse writing style, lack of examples and hard to follow explanations on some topics (without clear and simple code examples) will put off most of the new or intermediate programmers.
In my humble opinion this book is short for 200+ pages dedicated exclusively to code samples - I think examples in any reference book are as important as syntax and language explanations.
If you're already experienced programmer then you'll be more than satisfied with this book, just go ahead an click the button. If you're, on the other hand, starting to learn Python and need a good learning guide, I would recommend, that you begin with the book "Learning Python, 2 Edition" from O'Reilly.
22 comments|48 people found this helpful. Was this review helpful to you?YesNoReport abuse
on June 10, 2005
Python in a nutshell is an excellent reference for the experienced Python programmer. Alex Martelli does a wonderful job focusing on the book's goal of being a concise reference to important select portions of the Python language. His coverage of complex topics is a well balanced blend of written explanation and code examples. The book will be too advanced for newcomers to Python as well as beginning programmers, but for those looking to polish their Python skills this book is a real gem.

Like the other Nutshell books from O'Reilly, Python in a Nutshell is valuable as a desk reference. It has an excellent index that makes finding topics easy. Experienced programmers will appreciate the lack of "fluff" as each topic is explained efficiently. Martelli goes into detail where it is needed most. For example the coverage of Python's exception mechanisms is quite thorough and includes an insightful section on error-checking strategies. However, the coverage of some topics may be considered too cursory. I will need to search for more on Python's struct module as the roughly 2 pages on module struct, without any examples, left me wondering just how and why I'd need this module. This was the exception, rather than the rule, though. Martelli doesn't try to cover too much in this book and topics deemed too remedial or too tangential are noted by references to further reading. This is why I consider Python in a Nutshell to be an excellent reference while designing and coding.

Alex Martelli's writing style reflects what must be a very deep knowledge of the Python language. I get the feeling he knows Python at the most basic level which is reflected in his concise explanation of topics. Code examples are used sparingly throughout the book, mostly when including them enhances or augments the topic's explanation. I found the book filled with Pythonic gems: knowledgeable reflections on why one idiom is better implemented one way than another way. I found the section on Optimization especially enlightening. It contains Python specific optimization techniques I've not seen in other Python books, like why there are big-O performance gains achieved by avoiding string concatenation in preference to list operations or using operator % for string formatting. In general I was left feeling like I had a glimpse of how Python programming *should* be done.

The preface of the book includes an explanation that the book is meant for those with prior Python experience and/or experience developing in other languages. There is little coverage of the Python basics, except for the first few chapters which will help bring the reader up to speed quickly. I found the lack of review of the basics a refreshing diversion from the remedial-first-section-with-huge-code-listings pattern found in so many other programming books. Alex Martelli is so good at explaining how and why Python works the way it does that profuse code examples would be a distraction anyway. However, I think I've been collecting Python 'how' and 'why' questions for years now and was ready to have those questions answered. A newcomer to the language might not be as primed as I was and therefore might not appreciate Alex Martelli's obvious Python Zen. I expect to keep Python in a nutshell close at hand during all stages of development with Python. Alex Martelli has created an excellent reference that doesn't try to do too much but does achieve the goal of covering the most important parts of Python. Like Python in general, Martelli's writing style is concise, clear and readable. His book includes an insider's explanations of how best to program with Python. This book is a valuable reference for experienced programmers ready to take their Python skills to the next level.
0Comment|13 people found this helpful. Was this review helpful to you?YesNoReport abuse
on December 15, 2004
I bought this book after working through Learning Python by Lutz and Ascher, and reading sections of other books. It is now my #1 reference. The examples are few, but well chosen to do more than just demonstrate the language. They can show you why a particular syntax or technique is needed. Often I waste a lot of time learning something I don't really need, like lambda functions. By the time I have figured out that lambda functions are not some elegant new concept, just an awkward piece of syntax to do something simple, I've already spent too much time. Alternatively, I decide that something like metaclasses are a waste, and miss something really elegant and useful. Martelli's four pages on metaclasses capture better than anything I've read on the subject, exactly what metaclasses are good for and how they work.

I think the dynamite combo for someone learning Python is both the Nutshell and the Learning book. I would read the Nutshell chapter first ( assuming you have a little background in programming ) then work problems in Learning Python until you are comfortable. Then re-read Nutshell, highlighting the key points you might need to re-learn in the midst of a rush project. Python in a nutshell is the best distillation of Python wisdom I have seen anywhere.
0Comment|12 people found this helpful. Was this review helpful to you?YesNoReport abuse
on July 23, 2004
I've made a complete switch to Python from Perl, and this book has been a very, very helpful resource in doing so. I have owned several other O'Reilly's Nutshell books (C++, Linux, Perl, and Java) but never found them as useful as Python in a Nutshell.

Sure, Python does have a rather decent online documentation, which is free, but I often find it hard to find the exact information I want even using the index. Not the case with this Nutshell book; it covers the ground that you definitely need to know to get started early and do useful work immediately. Writing is very lucid, too.

I only give four stars just because I didn't necessarily like the section on object-oriented coding basics. I found Learning Python to be easier to understand in that regard.

This is not the best book if you are a programming beginner, but if you are trying to add Python to your programming arsenal knowning other languages already, I highly recommend this book as your handy companion.
0Comment|12 people found this helpful. Was this review helpful to you?YesNoReport abuse
on May 1, 2003
Four days ago, I had 10 years C++ experience and had never written a line of Python code. Today I am more productive in Python than I ever was in C++. I am not exaggerating. This book is largely responsible for my rapid ascent to proficiency.

All the glowing reviews are accurate. This book is well organized, well written, detailed, and easy to read. A true gem.

I highly recommend it.
0Comment|12 people found this helpful. Was this review helpful to you?YesNoReport abuse
on April 20, 2003
This is the best technical book I've ever seen. Beautifully presented and organized by a clear thinker, it has absolutely no filler. Martelli avoids the annoying witticisms and lame analogies which plague many computer books. Practically every topic of interest is covered, elegantly and concisely: this book teaches more in 10 pages than most books do in 50. Martelli nearly always provides additional references for more detail. This book is for those who either know Python already or are experienced programmers. I was able to learn the core language, advanced topics, and many libraries from this book. I should also mention that the Python is more enjoyable to use and more productive than any language I've ever used. The Python Cookbook, co-edited by Martelli, is also very good.
0Comment|11 people found this helpful. Was this review helpful to you?YesNoReport abuse
on September 15, 2003
I have to admit, when I got this book I intended to use it as a learning guide (even though he tells you that's not what this book is about). I struggled, but got through it. I then went and read additional documentation (online, available freely) just to help me get comfortable.
Now, I use it as my only reference guide. Once you have the basics, it clearly explains other topics that you may not be as familiar with. But you get it, b/c Python is so well structured. I would highly recommend this book if you are looking for a resource. If you are new to Python and have no other experience programming, this may not be the book for you...but after you learn the language, I'm sure you would still find it useful.
0Comment|11 people found this helpful. Was this review helpful to you?YesNoReport abuse

Send us feedback

How can we make Amazon Customer Reviews better for you?
Let us know here.