Nothing Special   »   [go: up one dir, main page]

skip to main content
Skip header Section
Python Essential ReferenceJuly 2009
Publisher:
  • Addison-Wesley Professional
ISBN:978-0-672-32978-4
Published:19 July 2009
Pages:
744
Skip Bibliometrics Section
Reflects downloads up to 09 Feb 2025Bibliometrics
Skip Abstract Section
Abstract

Every so often a book comes along that makes you ask yourself, "Gee, when was the last time I had my eyes checked?" David M. Beazley's Python: Essential Reference is just such a book. Condensing thousands of pages of Python online documentation into a compact 319-page softcover, Beazley and his editors used the old-college trick (often performed in reverse) of dickering with the font size to meet a putative page-limit requirement. The result is a truly condensed product fit for the occularly well-adjusted (nota bene). 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 prcis 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

Contributors
  • The University of Chicago

Reviews

Cristiana Bolchini

Numerous people have recommended using the Python language to easily and quickly develop programs that can extract information from log files and rewrite it in another form. Typically, I both use and teach C without any problem, although the parsing can be a little cumbersome. So, I took the advice and finished my work in a very short time. Since then, I've been looking for a good reference book on the language-while the Web is useful, it's not a good primary resource when learning a language from scratch. And, although I have knowledge of many other languages, I know little about Python, so I was interested in seeing whether the book successfully explained and taught all of the issues-both the easy and complex ones. The book is organized into three main sections: Part 1 is devoted to the language and all of its features; Part 2 presents the libraries the developer can use; and Part 3 covers extending and embedding Python. Chapter 1, "A Tutorial Introduction," quickly presents all the aspects of the language, in order to give the reader a preliminary but complete overview. This chapter enables developers who know how to program in another language to perceive the features and possibilities that the language offers. On the other hand, novice programmers can skip this chapter. The rest of Part 1-chapters 2 to 11-follows a more traditional path. Chapters 2 to 5 cover the basic elements necessary to write a program in Python-except for input/output (I/O) issues, which are presented in chapter 9. Chapters 6 to 8 deal with more advanced topics, such as the use of subprograms, classes typical of object-oriented programming, modules, and packages. The last two chapters are devoted to the execution environment and the best practices of testing and debugging, to support the actual program development process. Part 2-chapters 12 to 25-is devoted to the several built-in libraries that are available, including a concise but complete explanation of the numerous functions provided by the existing modules. Chapter 17, on the relational database access library that has all the functions to interface with a database, and chapter 19, on the modules for using the operating system services, are particularly noteworthy, and chapters 20 and 21 also present advanced topics-threads and concurrency, and network programming, respectively. This section also discusses aspects related to the Internet and Web programming, as a closing to the long overview of all possible application scenarios. The last chapter of the section is a mix of other library modules, which concludes the list of available ones. The very advanced Part 3-chapter 26-presents extension modules and Python 3. This is clearly a reference book that should not be used for teaching how to program. Sometimes, the strange order in which various aspects are presented will leave readers with questions that are only answered later. While some readers will be able to fill in any gaps with hypotheses from other, similar worlds, this will be difficult for novices. As for the rest of the book, it is a good reference for the language, with very brief snippets of code that show the syntax and use of an operator and a function. Online Computing Reviews Service

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Please enable JavaScript to view thecomments powered by Disqus.

Recommendations