• Fri frakt över 249 kr
  • •
  • Snabba leveranser
  • •
  • Billiga böcker
Kundservice

Du är på sajten för privatpersoner.

Företag, bibliotek eller offentlig verksamhet?

Du handlar på classic.bokus.com, där alla dina funktioner finns intakta.
Till classic.bokus.com
Bokus logotyp. Gå till startsidan.
  • Erbjudanden
  • Student
  • Topplistor
  • Barn & ungdom
  • Bokus Play
  • E-böcker
  • Ljudböcker
  • Pocketböcker
  • Spel och pussel

Pocketfynda! Hundratals böcker för 49 kr/st →

Sidfot

Mina sidor

    Hjälp

    • Kundservice
    • Vanliga frågor och svar
    • Frakt och leverans
    • Retur vid ångerrätt
    • Reklamera vara
    • Betalning
    • Köpvillkor
    • Allmänna villkor
    • Information om webbplatsens tillgänglighet

    Om Bokus

    • Om oss
    • Pressrum
    • För studenter
    • För företag
    • För bibliotek och offentlig verksamhet
    • För leverantörer
    • Hållbarhet

    Populärt

    • Aktuella erbjudanden
    • Presentkort
    • Studentlitteratur
    • Nya böcker
    • Topplistor
    • Signerade böcker
    • Engelska böcker

    Inspiration

    • Boktips
    • BookTok
    • Barnbokskaraktärer
    • Populära författare
    Logotyp för Bokus
    Följ oss på Facebook (extern länk)Följ oss på Instagram (extern länk)Följ oss på YouTube (extern länk)Följ oss på TikTok (extern länk)
    bokus @ CookiesAnpassa cookiesIntegritetspolicyKöpvillkor
    Till Citymail hemsida (extern länk)Till Budbee hemsida (extern länk)Till Postnord hemsida (extern länk)Till Schenker hemsida (extern länk)Till Early Bird hemsida (extern länk)Till Walleys hemsida (extern länk)
    1. Data och IT
    2. Programmeringsböcker
    3. Programspråk

    Effective Python

    59 Specific Ways to Write Better Python

    AvBrett Slatkin

    Häftad, Engelska, 2015

    Del i serien Effective Software Development Series

    278 kr

    Beställningsvara. Skickas inom 7-10 vardagar. Fri frakt över 249 kr.

    Fler format och utgåvor

    Häftad

    420 kr

    Häftad

    706 kr

    Beskrivning

    “Each item in Slatkin’s Effective Python teaches a self-contained lesson with its own source code. This makes the book random-access: Items are easy to browse and study in whatever order the reader needs. I will be recommending Effective Python to students as an admirably compact source of mainstream advice on a very broad range of topics for the intermediate Python programmer.”

    —Brandon Rhodes, software engineer at Dropbox and chair of PyCon 2016-2017

    It’s easy to start coding with Python, which is why the language is so popular. However, Python’s unique strengths, charms, and expressiveness can be hard to grasp, and there are hidden pitfalls that can easily trip you up.

    Effective Python will help you master a truly “Pythonic” approach to programming, harnessing Python’s full power to write exceptionally robust and well-performing code. Using the concise, scenario-driven style pioneered in Scott Meyers’ best-selling Effective C++, Brett Slatkin brings together 59 Python best practices, tips, and shortcuts, and explains them with realistic code examples.

    Drawing on years of experience building Python infrastructure at Google, Slatkin uncovers little-known quirks and idioms that powerfully impact code behavior and performance. You’ll learn the best way to accomplish key tasks, so you can write code that’s easier to understand, maintain, and improve.

    Key features include

    • Actionable guidelines for all major areas of Python 3.x and 2.x development, with detailed explanations and examples
    • Best practices for writing functions that clarify intention, promote reuse, and avoid bugs
    • Coverage of how to accurately express behaviors with classes and objects
    • Guidance on how to avoid pitfalls with metaclasses and dynamic attributes
    • More efficient approaches to concurrency and parallelism
    • Better techniques and idioms for using Python’s built-in modules
    • Tools and best practices for collaborative development
    • Solutions for debugging, testing, and optimization in order to improve quality and performance

    Produktinformation

    • Utgivningsdatum:2015-03-19
    • Mått:175 x 229 x 13 mm
    • Vikt:499 g
    • Format:Häftad
    • Språk:Engelska
    • Serie:Effective Software Development Series
    • Antal sidor:256
    • Upplaga:1
    • Förlag:Pearson Education
    • ISBN:9780134034287

    Utforska kategorier

    • Programspråk inom Data och IT

    Mer om författaren

    Brett Slatkin, senior staff software engineer at Google, is engineering lead and co-founder of Google Consumer Surveys. He previously worked on Google App Engine’s Python infrastructure, leveraged Python to manage Google’s enormous server fleet, and used Python to implement Google's system for PubSubHubbub, a protocol he co-created. Slatkin holds a B.S. in computer engineering from Columbia University in the City of New York. He lives in San Francisco.

    Recensioner i media

    "I've been programming in Python for years and thought I knew it pretty well. Thanks to this treasure trove of tips and techniques, I realize there's so much more I could be doing with my Python code to make it faster (e.g., using built-in data structures), easier to read (e.g., enforcing keyword-only arguments), and much more Pythonic (e.g., using zip to iterate over lists in parallel)." -Pamela Fox, educationeer, Khan Academy "If I had this book when I first switched from Java to Python, it would have saved me many months of repeated code rewrites, which happened each time I realized I was doing particular things 'non-Pythonically.' This book collects the vast majority of basic Python 'must-knows' into one place, eliminating the need to stumble upon them one-by-one over the course of months or years. The scope of the book is impressive, starting with the importance of PEP8 as well as that of major Python idioms, then reaching through function, method and class design, effective standard library use, quality API design, testing, and performance measurement-this book really has it all. A fantastic introduction to what it really means to be a Python programmer for both the novice and the experienced developer." -Mike Bayer, creator of SQLAlchemy "Effective Python will take your Python skills to the next level with clear guidelines for improving Python code style and function." -Leah Culver, developer advocate, Dropbox "This book is an exceptionally great resource for seasoned developers in other languages who are looking to quickly pick up Python and move beyond the basic language constructs into more Pythonic code. The organization of the book is clear, concise, and easy to digest, and each item and chapter can stand on its own as a meditation on a particular topic. The book covers the breadth of language constructs in pure Python without confusing the reader with the complexities of the broader Python ecosystem. For more seasoned developers the book provides in-depth examples of language constructs they may not have previously encountered, and provides examples of less commonly used language features. It is clear that the author is exceptionally facile with Python, and he uses his professional experience to alert the reader to common subtle bugs and common failure modes. Furthermore, the book does an excellent job of pointing out subtleties between Python 2.X and Python 3.X and could serve as a refresher course as one transitions between variants of Python." -Katherine Scott, software lead, Tempo Automation "This is a great book for both novice and experienced programmers. The code examples and explanations are well thought out and explained concisely and thoroughly." -C. Titus Brown, associate professor, UC Davis "This is an immensely useful resource for advanced Python usage and building cleaner, more maintainable software. Anyone looking to take their Python skills to the next level would benefit from putting the book's advice into practice." -Wes McKinney, creator of pandas; author of Python for Data Analysis; and software engineer at Cloudera

    Innehållsförteckning

    • Preface xiiiAcknowledgments xviiAbout the Author xixChapter 1: Pythonic Thinking 1Item 1: Know Which Version of Python You’re Using 1Item 2: Follow the PEP 8 Style Guide 2Item 3: Know the Differences Between bytes, str, and unicode 5Item 4: Write Helper Functions Instead of Complex Expressions 8Item 5: Know How to Slice Sequences 10Item 6: Avoid Using start, end, and stride in a Single Slice 13Item 7: Use List Comprehensions Instead of map and filter 15Item 8: Avoid More Than Two Expressions in List Comprehensions 16Item 9: Consider Generator Expressions for Large Comprehensions 18Item 10: Prefer enumerate Over range 20Item 11: Use zip to Process Iterators in Parallel 21Item 12: Avoid else Blocks After for and while Loops 23Item 13: Take Advantage of Each Block in try/except/else/finally 26Chapter 2: Functions 29Item 14: Prefer Exceptions to Returning None 29Item 15: Know How Closures Interact with Variable Scope 31Item 16: Consider Generators Instead of Returning Lists 36Item 17: Be Defensive When Iterating Over Arguments 38Item 18: Reduce Visual Noise with Variable Positional Arguments 43Item 19: Provide Optional Behavior with Keyword Arguments 45Item 20: Use None and Docstrings to Specify Dynamic Default Arguments 48Item 21: Enforce Clarity with Keyword-Only Arguments 51Chapter 3: Classes and Inheritance 55Item 22: Prefer Helper Classes Over Bookkeeping with Dictionaries and Tuples 55Item 23: Accept Functions for Simple Interfaces Instead of Classes 61Item 24: Use @classmethod Polymorphism to Construct Objects Generically 64Item 25: Initialize Parent Classes with super 69Item 26: Use Multiple Inheritance Only for Mix-in Utility Classes 73Item 27: Prefer Public Attributes Over Private Ones 78Item 28: Inherit from collections.abc for Custom Container Types 83Chapter 4: Metaclasses and Attributes 87Item 29: Use Plain Attributes Instead of Get and Set Methods 87Item 30: Consider @property Instead of Refactoring Attributes 91Item 31: Use Descriptors for Reusable @property Methods 95Item 32: Use __getattr__, __getattribute__, and __setattr__ for Lazy Attributes 100Item 33: Validate Subclasses with Metaclasses 105Item 34: Register Class Existence with Metaclasses 108Item 35: Annotate Class Attributes with Metaclasses 112Chapter 5: Concurrency and Parallelism 117Item 36: Use subprocess to Manage Child Processes 118Item 37: Use Threads for Blocking I/O, Avoid for Parallelism 122Item 38: Use Lock to Prevent Data Races in Threads 126Item 39: Use Queue to Coordinate Work Between Threads 129Item 40: Consider Coroutines to Run Many Functions Concurrently 136Item 41: Consider concurrent.futures for True Parallelism 145Chapter 6: Built-in Modules 151Item 42: Define Function Decorators with functools.wraps 151Item 43: Consider contextlib and with Statements for Reusable try/finally Behavior 153Item 44: Make pickle Reliable with copyreg 157Item 45: Use datetime Instead of time for Local Clocks 162Item 46: Use Built-in Algorithms and Data Structures 166Item 47: Use decimal When Precision Is Paramount 171Item 48: Know Where to Find Community-Built Modules 173Chapter 7: Collaboration 175Item 49: Write Docstrings for Every Function, Class, and Module 175Item 50: Use Packages to Organize Modules and Provide Stable APIs 179Item 51: Define a Root Exception to Insulate Callers from APIs 184Item 52: Know How to Break Circular Dependencies 187Item 53: Use Virtual Environments for Isolated andReproducible Dependencies 192Chapter 8: Production 199Item 54: Consider Module-Scoped Code to Configure Deployment Environments 199Item 55: Use repr Strings for Debugging Output 202Item 56: Test Everything with unittest 204Item 57: Consider Interactive Debugging with pdb 208Item 58: Profile Before Optimizing 209Item 59: Use tracemalloc to Understand Memory Usage and Leaks 214Index 217

    Betyg & recensioner

    4/5