- Tapa blanda: 63 páginas
- Editor: Createspace Independent Pub (10 de febrero de 2013)
- Idioma: Inglés
- ISBN-10: 1482374811
- ISBN-13: 978-1482374810
- Valoración media de los clientes: 1 opinión de cliente
- Clasificación en los más vendidos de Amazon: nº245.757 en Libros en idiomas extranjeros (Ver el Top 100 en Libros en idiomas extranjeros)
Compara Precios en Amazon
+ Envío GRATIS
Writing Idiomatic Python 3.3 (Inglés) Tapa blanda – 10 feb 2013
|Nuevo desde||Usado desde|
Los clientes que compraron este producto también compraron
Descripción del producto
Reseña del editor
The "Writing Idiomatic Python" book is finally here! Chock full of code samples, you'll learn the "Pythonic" way to accomplish common tasks. Each idiom comes with a detailed description, example code showing the "wrong" way to do it, and code for the idiomatic, "Pythonic" alternative. *This version of the book is for Python 3. There is also a Python 2.7+ version available.* "Writing Idiomatic Python" contains the most common and important Python idioms in a format that maximizes identification and understanding. Each idiom is presented as a recommendation to write some commonly used piece of code. It is followed by an explanation of why the idiom is important. It also contains two code samples: the "Harmful" way to write it and the "Idiomatic" way. * The "Harmful" way helps you identify the idiom in your own code. * The "Idiomatic" way shows you how to easily translate that code into idiomatic Python. This book is perfect for you: * If you're coming to Python from another programming language * If you're learning Python as a first programming language * If you're looking to increase the readability, maintainability, and correctness of your Python code What is "Idiomatic" Python? Every programming language has its own idioms. Programming language idioms are nothing more than the generally accepted way of writing a certain piece of code. Consistently writing idiomatic code has a number of important benefits: * Others can read and understand your code easily * Others can maintain and enhance your code with minimal effort * Your code will contain fewer bugs * Your code will teach others to write correct code without any effort on your part
No es necesario ningún dispositivo Kindle. Descárgate una de las apps de Kindle gratuitas para comenzar a leer libros Kindle en tu smartphone, tablet u ordenador.
Obtén la app gratuita:
Detalles del producto
Si eres el vendedor de este producto, ¿te gustaría sugerir ciertos cambios a través del servicio de atención al vendedor?
Opiniones de clientes
Principales opiniones de clientes
Ha surgido un problema al filtrar las opiniones justo en este momento. Vuelva a intentarlo en otro momento.
Opiniones de clientes más útiles en Amazon.com
Python has plethora of cool ways to trim down and beautify code. This book deals with them one by one.
What I liked:
I learned a lot of "hidden" features..well, hidden for beginners/intermediate users at least, some of which follow:
- Use of iterable to avoid repetition of value comparison. Sample: if name in ('Tom', 'Dick', 'Harry')
- Use of enumerate() function to eliminate maintenance of an explicit index variable in a loop.
- * operator to represent "rest" of a list while unpacking it.
- Along the same line of unpacking, use of '_' as a placeholder to ignore an unpacked value.
- Clever use of set to eliminate duplicate entries from an Iterable.
- Swiss knife for Iterables: itertools module
What I disliked:
I object against avoiding explicit comparison to None. Agreed, the author has pointed out an exception where one should explicitly compare with None. However, I find it safer to be consistent.
Also, I find it a bit aggressive to use the title "Harmful" in order to depict the non-recommended code sample. I would rather prefer terms "Pythonic" and "UnPythonic".
Who should read this book?
This is a must-read book for people who are acquainted with Python. Complete beginners, however, might find it difficult to keep their heads above water. It kind of hangs in between post-beginner and advanced levels.
I would strongly recommend this book to the Java/c# immigrants. With such a short Pythonic reference in hand, they should feel themselves at home.
Even those who have been writing in Python since long, but are still unaware of Pythonic style of writing code, could find this book an enlightening read.
That said, it could stand a couple of improvements around layout.
Towards the beginning, (section 5) the author says, for brevity, scripts omit this line:
if __name__ == '__main__'
That's great. However, you don't find out what that means (or why it's important) until section 7.
Also, while the author mentions R. Daneel Olivaw as a contributor, he didn't include Elijah Bailey. I find that odd.Then again, I'm not a detective or a mind reader.