| ||||||||||||
|
There is a newer edition of this item:
|
Product Details
Would you like to update product info or give feedback on images?
|
Beazley's subject is Python, a full-featured, freely-redistributable, POSIX-compliant (platforms include Linux, Unix, Macintosh, and Windows) scripting language that is based on object-oriented design principles. As advertised, Beazley's source release (1.5.2) is available from an unfortunately slow server at www.python.org. The installation under Linux (Redhat 5.2) proceeded without incident.
Beazley holds true to his catalogic purpose: fully 230 pages are formatted as technical appendices and indices covering the standard litany: built-in function syntax, database features, OS-level interfaces, Internet interfaces, and compiling/profiling/debugging. All references are fully annotated and illustrated with example source code that runs from a couple of lines to a couple of pages. In lock step with competing scripting languages, Python is extensible and embeddable in C and C++, and with blitzkrieg efficiency, Beazley summarizes these crucial practical issues in the final 30 pages. Python users who are tired of chasing questions through hyperlinked online documents will benefit from the expansive random-access index.
Python the book captures the orderliness of Python the language. Beazley begins with an 86-page précis of Python in the fashion of Kernighan and Ritchie: too brief for a newbie tutorial but enough to propel old hands into a scripting language that aspires to the elegance of a compiled language.
Indeed, it is a byte-compiling language. The line bytecode=compile("some_python_script",'','exec')) creates 'bytecode' as a token executed by exec bytecode. But a five-minute investigation through Beazley's book does not describe how 'bytecode' can be written into a separate executable file. If writing the byte-compiled code to a file is not possible, Python suffers from the limitations of other scripting languages: the executable is the source and cannot be hidden from the user, at least not without some difficulty. Despite its extensibility, embeddability, and pleasing architecture, Python is like other scripting languages: appropriate for solving small nonproprietary problems.
Those familiar with more established scriptors like Perl may ask, "Why Python?" Unlike Perl, Python is a product of the fully object-oriented (OO) era, and its constructs reflect design principles that aspire beyond keystroke shortcuts of the succinct-but-often-arcane Perl. Python creator Guido van Rossum cleansed Perl's idiosyncracies and objectified basic data structure, data manipulations, and I/O. With Python, OO is so intrinsic that learning Python is equivalent to learning OO. The same cannot be said of Perl.
Unfortunately, comparisons with other languages are missing from Beazley's book. Van Rossum, in an embarrassingly self-serving foreword, preemptively asserts that we readers need "neither evangelizing nor proselytizing"--after all, we already own the book--but we do need galvanizing and we don't find it. Specifically, we need a response to the oft-repeated wisdom that new computer languages are only worth learning if they teach us to organize our thinking along new lines.
Scripting languages, however, are for quick and dirty projects: quick to write, easy to hack, and ultimately disposable. The essential tension created by van Rossum and friends is between the elegance of object-oriented principles and the utility of a quick-hacked script. Sadly, the tension remains unresolved in Beazley's reference. There is little to convince us that Python has earned its place in the firmament by changing our thinking. But Beazley has given us much to get us going if we have already taken the leap of faith. --Peter Leopold --This text refers to an out of print or unavailable edition of this title.
There is a tutorial introduction plus an intermediate-level description of core language features, about 100 pages long, which is useful to read for an alternate perspective into the structure of the language. The library reference section (bulk of the book, Appendix A) is well-organized and very usable.
Unfortunately for the utility of this book, the online documentation at the python webpage happens to be of excellent quality. Also, there is at least one other book (Python in a Nutshell, by Alex Martelli) that covers similar ground (tutorial + reference). This makes the "Essential Reference" not quite essential: it can be replaced by browser windows pointing to the python webpage, or by other books.
I have a bit of non-conventional advice: it seems to me that the casual programmer can make do with an earlier (cheaper :-) edition of the book. Most of the features of the language have been around since python 1.5.2, covered in the first edition. If you actually need to use features added later (e.g., list comprehensions, borrowed from Haskell), you can easily learn them from online sources. In any case, as far as advanced features are concerned, the latest edition is likely also to be soon outdated.
The book takes a no-nonsense approach to explaining the nuances of the language. If you are already familiar with practically any other serious OO language, you'll be able to pick up Python in a matter of hours from this.
The bulk of the book is a handy reference to the very large list of python modules (libraries). This makes for good bathroom reading. :-)
My only complaint about the second edition is that it was rewritten to directly incorporate the changes since v1.5 into the text. Since I already had the first edition, it would have been helpful if there were something as simple as change bars in the text itself for info specific to 2.0 and 2.1, although there is a summary of changes in an appendix.
Overall, still the best Python reference out there.
The second half of the book is Appendix A, which covers the Python's standard library. I think it's odd that an entire section of 200+ pages is considered an appendix, but that is only a minor flaw.
The reason that I give the book only four stars and not five is that Appendix A could use some more of the clever formatting applied to the first part of the book to make it more accessible. The information is all there, but it could be formatted a little better. O'Reilly does a great job with that sort of thing.
Overall, this is a great handy reference for Python. Far better than the online documentation. If you are an occasional Python programmer, like me, you will find this book a great resource because you can get a quick refresher whenever you need it.
|