Opis ebooka: Fluent Python. 2nd Edition
Don't waste time bending Python to fit patterns you've learned in other languages. Python's simplicity lets you become productive quickly, but often this means you aren't using everything the language has to offer. With the updated edition of this hands-on guide, you'll learn how to write effective, modern Python 3 code by leveraging its best ideas.
Discover and apply idiomatic Python 3 features beyond your past experience. Author Luciano Ramalho guides you through Python's core language features and libraries and teaches you how to make your code shorter, faster, and more readable.
Complete with major updates throughout, this new edition features five parts that work as five short books within the book:
- Data structures: Sequences, dicts, sets, Unicode, and data classes
- Functions as objects: First-class functions, related design patterns, and type hints in function declarations
- Object-oriented idioms: Composition, inheritance, mixins, interfaces, operator overloading, protocols, and more static types
- Control flow: Context managers, generators, coroutines, async/await, and thread/process pools
- Metaprogramming: Properties, attribute descriptors, class decorators, and new class metaprogramming hooks that replace or simplify metaclasses
Wybrane bestsellery
-
Nie marnuj czasu, próbując nagiąć Pythona, aby pasował do wzorców opanowanych w innych językach programowania. Prostota Pythona pozwala szybko osiągnąć produktywność, ale często oznacza to, że nie korzystamy ze wszystkich możliwści oferowanych przez język. Dzięki nowemu wydaniu tego podręcznika n...
Zaawansowany Python, wyd. 2. Przejrzyste, zwięzłe i efektywne programowanie Zaawansowany Python, wyd. 2. Przejrzyste, zwięzłe i efektywne programowanie
(179.10 zł najniższa cena z 30 dni)179.10 zł
199.00 zł(-10%) -
Prostota języka Python pozwala szybko osiągnąć produktywność, ale oznacza to również, że często nie wykorzystujemy wszystkiego, co ma da zaoferowania. Dzięki temu praktycznemu poradnikowi Czytelnik nauczy się, jak pisać efektywny, idiomatyczny kod Pythona dzięki wykorzystaniu jego najlepsz...
Zaawansowany Python. Jasne, zwięzłe i efektywne programowanie Zaawansowany Python. Jasne, zwięzłe i efektywne programowanie
(134.10 zł najniższa cena z 30 dni)134.10 zł
149.00 zł(-10%) -
Oto zaktualizowane wydanie popularnego przewodnika, dzięki któremu skorzystasz z ponad dwustu sprawdzonych receptur bazujących na najnowszych wydaniach bibliotek Pythona. Wystarczy, że skopiujesz i dostosujesz kod do swoich potrzeb. Możesz też go uruchamiać i testować za pomocą przykładowego zbio...
Uczenie maszynowe w Pythonie. Receptury. Od przygotowania danych do deep learningu. Wydanie II Uczenie maszynowe w Pythonie. Receptury. Od przygotowania danych do deep learningu. Wydanie II
(57.84 zł najniższa cena z 30 dni)62.30 zł
89.00 zł(-30%) -
Oto uzupełnione i zaktualizowane wydanie bestsellerowego przewodnika dla inżynierów sieci. Dzięki niemu przejdziesz trudną (ale ekscytującą!) drogę od tradycyjnej platformy do platformy sieciowej opartej na najlepszych praktykach programistycznych. Zaczniesz od zagadnień podstawowych, aby następn...
Zaawansowana inżynieria sieci w Pythonie. Automatyzacja, monitorowanie i zarządzanie chmurą. Wydanie IV Zaawansowana inżynieria sieci w Pythonie. Automatyzacja, monitorowanie i zarządzanie chmurą. Wydanie IV
(77.40 zł najniższa cena z 30 dni)90.30 zł
129.00 zł(-30%) -
Oto drugie, zaktualizowane i uzupełnione wydanie przewodnika po bibliotece Pandas. Dzięki tej przystępnej książce nauczysz się w pełni korzystać z możliwości oferowanych przez bibliotekę, nawet jeśli dopiero zaczynasz przygodę z analizą danych w Pythonie. Naukę rozpoczniesz z użyciem rzeczywisteg...
Jak analizować dane z biblioteką Pandas. Praktyczne wprowadzenie. Wydanie II Jak analizować dane z biblioteką Pandas. Praktyczne wprowadzenie. Wydanie II
(65.40 zł najniższa cena z 30 dni)76.30 zł
109.00 zł(-30%) -
Python, stanowiący czołowy temat tego kursu, jest jednym z najpopularniejszych języków programowania na świecie. Słynie z wszechstronności, czytelności i dużej społeczności użytkowników. W świecie finansów Python zyskał szczególne uznanie ze względu na swoją efektywność w analizie danych, modelow...
Python i finanse. Kurs video. Tworzenie modeli, prognoz i analiz rynkowych Python i finanse. Kurs video. Tworzenie modeli, prognoz i analiz rynkowych
(39.90 zł najniższa cena z 30 dni)107.60 zł
269.00 zł(-60%) -
Zanurz się w fascynujący świat programowania w języku Python i osiągnij imponujący poziom umiejętności w zaledwie 24 godziny! Oto kilka zalet, które sprawiają, że ta książka jest niezbędna dla każdego aspirującego programisty: Szybki start: podstawy Pythona już w pierwszych godzinach nauki ...
Python w 1 dzień. Nauka programowania w Pythonie w 24 godziny od A do Z Python w 1 dzień. Nauka programowania w Pythonie w 24 godziny od A do Z
-
Czy zastanawiasz się czasem nad tym, jak to możliwe, że jesteśmy w stanie „rozmawiać” z maszynami? Że coś mówimy, a one nas rozumieją i odpowiadają na nasze pytania, realizują polecenia, wykonują zadania? I na odwrót – to one mówią (i piszą) do nas słowami, które są dla nas jasn...
NLP. Kurs video. Analiza danych tekstowych w języku Python NLP. Kurs video. Analiza danych tekstowych w języku Python
(39.90 zł najniższa cena z 30 dni)52.15 zł
149.00 zł(-65%) -
To książka przeznaczona dla osób, które pracują ze zbiorami danych. Jest praktycznym przewodnikiem po koncepcjach algebry liniowej, pomyślanym tak, by ułatwić ich zrozumienie i zastosowanie w użytecznych obliczeniach. Poszczególne zagadnienia przedstawiono za pomocą kodu Pythona, wraz z przykłada...
Praktyczna algebra liniowa dla analityków danych. Od podstawowych koncepcji do użytecznych aplikacji w Pythonie Praktyczna algebra liniowa dla analityków danych. Od podstawowych koncepcji do użytecznych aplikacji w Pythonie
(46.20 zł najniższa cena z 30 dni)53.90 zł
77.00 zł(-30%) -
Ta książka stanowi wszechstronne omówienie wszystkich bibliotek Pythona, potrzebnych naukowcom i specjalistom pracującym z danymi. Znalazł się tu dokładny opis IPythona, NumPy, Pandas, Matplotlib, Scikit-Learn i innych narzędzi. Podręcznik uwzględnia przede wszystkim ich aspekty praktyczne, dzięk...
Python Data Science. Niezbędne narzędzia do pracy z danymi. Wydanie II Python Data Science. Niezbędne narzędzia do pracy z danymi. Wydanie II
(77.40 zł najniższa cena z 30 dni)90.30 zł
129.00 zł(-30%)
Ebooka "Fluent Python. 2nd Edition" przeczytasz na:
-
czytnikach Inkbook, Kindle, Pocketbook, Onyx Boox i innych
-
systemach Windows, MacOS i innych
-
systemach Windows, Android, iOS, HarmonyOS
-
na dowolnych urządzeniach i aplikacjach obsługujących formaty: PDF, EPub, Mobi
Masz pytania? Zajrzyj do zakładki Pomoc »
Audiobooka "Fluent Python. 2nd Edition" posłuchasz:
-
w aplikacji Ebookpoint na Android, iOS, HarmonyOs
-
na systemach Windows, MacOS i innych
-
na dowolnych urządzeniach i aplikacjach obsługujących format MP3 (pliki spakowane w ZIP)
Masz pytania? Zajrzyj do zakładki Pomoc »
Kurs Video "Fluent Python. 2nd Edition" zobaczysz:
-
w aplikacjach Ebookpoint i Videopoint na Android, iOS, HarmonyOs
-
na systemach Windows, MacOS i innych z dostępem do najnowszej wersji Twojej przeglądarki internetowej
Szczegóły ebooka
- ISBN Ebooka:
- 978-14-920-5630-0, 9781492056300
- Data wydania ebooka:
- 2022-03-31 Data wydania ebooka często jest dniem wprowadzenia tytułu do sprzedaży i może nie być równoznaczna z datą wydania książki papierowej. Dodatkowe informacje możesz znaleźć w darmowym fragmencie. Jeśli masz wątpliwości skontaktuj się z nami sklep@ebookpoint.pl.
- Język publikacji:
- angielski
- Rozmiar pliku ePub:
- 9.3MB
- Rozmiar pliku Mobi:
- 26.2MB
Spis treści ebooka
- Preface
- Who This Book Is For
- Who This Book Is Not For
- Five Books in One
- How the Book Is Organized
- Hands-On Approach
- Soapbox: My Personal Perspective
- Companion Website: fluentpython.com
- Conventions Used in This Book
- Using Code Examples
- OReilly Online Learning
- How to Contact Us
- Acknowledgments
- Acknowledgments for the First Edition
- I. Data Structures
- 1. The Python Data Model
- Whats New in This Chapter
- A Pythonic Card Deck
- How Special Methods Are Used
- Emulating Numeric Types
- String Representation
- Boolean Value of a Custom Type
- Collection API
- Overview of Special Methods
- Why len Is Not a Method
- Chapter Summary
- Further Reading
- 2. An Array of Sequences
- Whats New in This Chapter
- Overview of Built-In Sequences
- List Comprehensions and Generator Expressions
- List Comprehensions and Readability
- Listcomps Versus map and filter
- Cartesian Products
- Generator Expressions
- Tuples Are Not Just Immutable Lists
- Tuples as Records
- Tuples as Immutable Lists
- Comparing Tuple and List Methods
- Unpacking Sequences and Iterables
- Using * to Grab Excess Items
- Unpacking with * in Function Calls and Sequence Literals
- Nested Unpacking
- Pattern Matching with Sequences
- Pattern Matching Sequences in an Interpreter
- Alternative patterns for lambda
- Shortcut syntax for function definition
- Pattern Matching Sequences in an Interpreter
- Slicing
- Why Slices and Ranges Exclude the Last Item
- Slice Objects
- Multidimensional Slicing and Ellipsis
- Assigning to Slices
- Using + and * with Sequences
- Building Lists of Lists
- Augmented Assignment with Sequences
- A += Assignment Puzzler
- list.sort Versus the sorted Built-In
- When a List Is Not the Answer
- Arrays
- Memory Views
- NumPy
- Deques and Other Queues
- Chapter Summary
- Further Reading
- 3. Dictionaries and Sets
- Whats New in This Chapter
- Modern dict Syntax
- dict Comprehensions
- Unpacking Mappings
- Merging Mappings with |
- Pattern Matching with Mappings
- Standard API of Mapping Types
- What Is Hashable
- Overview of Common Mapping Methods
- Inserting or Updating Mutable Values
- Automatic Handling of Missing Keys
- defaultdict: Another Take on Missing Keys
- The __missing__ Method
- Inconsistent Usage of __missing__ in the Standard Library
- Variations of dict
- collections.OrderedDict
- collections.ChainMap
- collections.Counter
- shelve.Shelf
- Subclassing UserDict Instead of dict
- Immutable Mappings
- Dictionary Views
- Practical Consequences of How dict Works
- Set Theory
- Set Literals
- Set Comprehensions
- Practical Consequences of How Sets Work
- Set Operations
- Set Operations on dict Views
- Chapter Summary
- Further Reading
- 4. Unicode Text Versus Bytes
- Whats New in This Chapter
- Character Issues
- Byte Essentials
- Basic Encoders/Decoders
- Understanding Encode/Decode Problems
- Coping with UnicodeEncodeError
- Coping with UnicodeDecodeError
- SyntaxError When Loading Modules with Unexpected Encoding
- How to Discover the Encoding of a Byte Sequence
- BOM: A Useful Gremlin
- Handling Text Files
- Beware of Encoding Defaults
- Normalizing Unicode for Reliable Comparisons
- Case Folding
- Utility Functions for Normalized Text Matching
- Extreme Normalization: Taking Out Diacritics
- Sorting Unicode Text
- Sorting with the Unicode Collation Algorithm
- The Unicode Database
- Finding Characters by Name
- Numeric Meaning of Characters
- Dual-Mode str and bytes APIs
- str Versus bytes in Regular Expressions
- str Versus bytes in os Functions
- Chapter Summary
- Further Reading
- 5. Data Class Builders
- Whats New in This Chapter
- Overview of Data Class Builders
- Main Features
- Mutable instances
- Class statement syntax
- Construct dict
- Get field names and default values
- Get field types
- New instance with changes
- New class at runtime
- Main Features
- Classic Named Tuples
- Typed Named Tuples
- Type Hints 101
- No Runtime Effect
- Variable Annotation Syntax
- The Meaning of Variable Annotations
- Inspecting a typing.NamedTuple
- Inspecting a class decorated with dataclass
- More About @dataclass
- Field Options
- Post-init Processing
- Typed Class Attributes
- Initialization Variables That Are Not Fields
- @dataclass Example: Dublin Core Resource Record
- Data Class as a Code Smell
- Data Class as Scaffolding
- Data Class as Intermediate Representation
- Pattern Matching Class Instances
- Simple Class Patterns
- Keyword Class Patterns
- Positional Class Patterns
- Chapter Summary
- Further Reading
- 6. Object References, Mutability, and Recycling
- Whats New in This Chapter
- Variables Are Not Boxes
- Identity, Equality, and Aliases
- Choosing Between == and is
- The Relative Immutability of Tuples
- Copies Are Shallow by Default
- Deep and Shallow Copies of Arbitrary Objects
- Function Parameters as References
- Mutable Types as Parameter Defaults: Bad Idea
- Defensive Programming with Mutable Parameters
- del and Garbage Collection
- Tricks Python Plays with Immutables
- Chapter Summary
- Further Reading
- II. Functions as Objects
- 7. Functions as First-Class Objects
- Whats New in This Chapter
- Treating a Function Like an Object
- Higher-Order Functions
- Modern Replacements for map, filter, and reduce
- Anonymous Functions
- The Nine Flavors of Callable Objects
- User-Defined Callable Types
- From Positional to Keyword-Only Parameters
- Positional-Only Parameters
- Packages for Functional Programming
- The operator Module
- Freezing Arguments with functools.partial
- Chapter Summary
- Further Reading
- 8. Type Hints in Functions
- Whats New in This Chapter
- About Gradual Typing
- Gradual Typing in Practice
- Starting with Mypy
- Making Mypy More Strict
- A Default Parameter Value
- Using None as a Default
- Types Are Defined by Supported Operations
- Types Usable in Annotations
- The Any Type
- Subtype-of versus consistent-with
- The Any Type
- Simple Types and Classes
- Optional and Union Types
- Generic Collections
- Tuple Types
- Tuples as records
- Tuples as records with named fields
- Tuples as immutable sequences
- Generic Mappings
- Abstract Base Classes
- The fall of the numeric tower
- Iterable
- abc.Iterable versus abc.Sequence
- Parameterized Generics and TypeVar
- Restricted TypeVar
- Bounded TypeVar
- The AnyStr predefined type variable
- Static Protocols
- Callable
- Variance in Callable types
- NoReturn
- Annotating Positional Only and Variadic Parameters
- Imperfect Typing and Strong Testing
- Chapter Summary
- Further Reading
- 9. Decorators and Closures
- Whats New in This Chapter
- Decorators 101
- When Python Executes Decorators
- Registration Decorators
- Variable Scope Rules
- Closures
- The nonlocal Declaration
- Variable Lookup Logic
- Implementing a Simple Decorator
- How It Works
- Decorators in the Standard Library
- Memoization with functools.cache
- Using lru_cache
- Single Dispatch Generic Functions
- Function singledispatch
- Parameterized Decorators
- A Parameterized Registration Decorator
- The Parameterized Clock Decorator
- A Class-Based Clock Decorator
- Chapter Summary
- Further Reading
- 10. Design Patterns with First-Class Functions
- Whats New in This Chapter
- Case Study: Refactoring Strategy
- Classic Strategy
- Function-Oriented Strategy
- Choosing the Best Strategy: Simple Approach
- Finding Strategies in a Module
- Decorator-Enhanced Strategy Pattern
- The Command Pattern
- Chapter Summary
- Further Reading
- III. Classes and Protocols
- 11. A Pythonic Object
- Whats New in This Chapter
- Object Representations
- Vector Class Redux
- An Alternative Constructor
- classmethod Versus staticmethod
- Formatted Displays
- A Hashable Vector2d
- Supporting Positional Pattern Matching
- Complete Listing of Vector2d, Version 3
- Private and Protected Attributes in Python
- Saving Memory with __slots__
- Simple Measure of __slot__ Savings
- Summarizing the Issues with __slots__
- Overriding Class Attributes
- Chapter Summary
- Further Reading
- 12. Special Methods for Sequences
- Whats New in This Chapter
- Vector: A User-Defined Sequence Type
- Vector Take #1: Vector2d Compatible
- Protocols and Duck Typing
- Vector Take #2: A Sliceable Sequence
- How Slicing Works
- A Slice-Aware __getitem__
- Vector Take #3: Dynamic Attribute Access
- Vector Take #4: Hashing and a Faster ==
- Vector Take #5: Formatting
- Chapter Summary
- Further Reading
- 13. Interfaces, Protocols, and ABCs
- The Typing Map
- Whats New in This Chapter
- Two Kinds of Protocols
- Programming Ducks
- Python Digs Sequences
- Monkey Patching: Implementing a Protocol at Runtime
- Defensive Programming and Fail Fast
- Goose Typing
- Subclassing an ABC
- ABCs in the Standard Library
- Defining and Using an ABC
- ABC Syntax Details
- Subclassing an ABC
- A Virtual Subclass of an ABC
- Usage of register in Practice
- Structural Typing with ABCs
- Static Protocols
- The Typed double Function
- Runtime Checkable Static Protocols
- Limitations of Runtime Protocol Checks
- Supporting a Static Protocol
- Designing a Static Protocol
- Best Practices for Protocol Design
- Extending a Protocol
- The numbers ABCs and Numeric Protocols
- Chapter Summary
- Further Reading
- 14. Inheritance: For Better or for Worse
- Whats New in This Chapter
- The super() Function
- Subclassing Built-In Types Is Tricky
- Multiple Inheritance and Method Resolution Order
- Mixin Classes
- Case-Insensitive Mappings
- Multiple Inheritance in the Real World
- ABCs Are Mixins Too
- ThreadingMixIn and ForkingMixIn
- Django Generic Views Mixins
- Multiple Inheritance in Tkinter
- Coping with Inheritance
- Favor Object Composition over Class Inheritance
- Understand Why Inheritance Is Used in Each Case
- Make Interfaces Explicit with ABCs
- Use Explicit Mixins for Code Reuse
- Provide Aggregate Classes to Users
- Subclass Only Classes Designed for Subclassing
- Avoid Subclassing from Concrete Classes
- Tkinter: The Good, the Bad, and the Ugly
- Chapter Summary
- Further Reading
- 15. More About Type Hints
- Whats New in This Chapter
- Overloaded Signatures
- Max Overload
- Arguments implementing SupportsLessThan, but key and default not provided
- Argument key provided, but no default
- Argument default provided, but no key
- Arguments key and default provided
- Max Overload
- Takeaways from Overloading max
- TypedDict
- Type Casting
- Reading Type Hints at Runtime
- Problems with Annotations at Runtime
- Dealing with the Problem
- Implementing a Generic Class
- Basic Jargon for Generic Types
- Variance
- An Invariant Dispenser
- A Covariant Dispenser
- A Contravariant Trash Can
- Variance Review
- Invariant types
- Covariant types
- Contravariant types
- Variance rules of thumb
- Implementing a Generic Static Protocol
- Chapter Summary
- Further Reading
- 16. Operator Overloading
- Whats New in This Chapter
- Operator Overloading 101
- Unary Operators
- Overloading + for Vector Addition
- Overloading * for Scalar Multiplication
- Using @ as an Infix Operator
- Wrapping-Up Arithmetic Operators
- Rich Comparison Operators
- Augmented Assignment Operators
- Chapter Summary
- Further Reading
- IV. Control Flow
- 17. Iterators, Generators,
and Classic Coroutines
- Whats New in This Chapter
- A Sequence of Words
- Why Sequences Are Iterable: The iter Function
- Using iter with a Callable
- Iterables Versus Iterators
- Sentence Classes with __iter__
- Sentence Take #2: A Classic Iterator
- Dont Make the Iterable an Iterator for Itself
- Sentence Take #3: A Generator Function
- How a Generator Works
- Lazy Sentences
- Sentence Take #4: Lazy Generator
- Sentence Take #5: Lazy Generator Expression
- When to Use Generator Expressions
- An Arithmetic Progression Generator
- Arithmetic Progression with itertools
- Generator Functions in the Standard Library
- Iterable Reducing Functions
- Subgenerators with yield from
- Reinventing chain
- Traversing a Tree
- Generic Iterable Types
- Classic Coroutines
- Example: Coroutine to Compute a Running Average
- Returning a Value from a Coroutine
- Generic Type Hints for Classic Coroutines
- Chapter Summary
- Further Reading
- 18. with, match, and else Blocks
- Whats New in This Chapter
- Context Managers and with Blocks
- The contextlib Utilities
- Using @contextmanager
- Pattern Matching in lis.py: A Case Study
- Scheme Syntax
- Imports and Types
- The Parser
- The Environment
- The REPL
- The Evaluator
- Evaluating numbers
- Evaluating symbols
- (quote )
- (if )
- (lambda )
- (define )
- (set! )
- Function call
- Catch syntax errors
- Procedure: A Class Implementing a Closure
- Using OR-patterns
- Do This, Then That: else Blocks Beyond if
- Chapter Summary
- Further Reading
- 19. Concurrency Models in Python
- Whats New in This Chapter
- The Big Picture
- A Bit of Jargon
- Processes, Threads, and Pythons Infamous GIL
- A Concurrent Hello World
- Spinner with Threads
- Spinner with Processes
- Spinner with Coroutines
- Experiment: Break the spinner for an insight
- Supervisors Side-by-Side
- The Real Impact of the GIL
- Quick Quiz
- 1. Answer for multiprocessing
- 2. Answer for threading
- 3. Answer for asyncio
- Quick Quiz
- A Homegrown Process Pool
- Process-Based Solution
- Understanding the Elapsed Times
- Code for the Multicore Prime Checker
- Experimenting with More or Fewer Processes
- Thread-Based Nonsolution
- Python in the Multicore World
- System Administration
- Data Science
- Server-Side Web/Mobile Development
- WSGI Application Servers
- Distributed Task Queues
- Chapter Summary
- Further Reading
- Concurrency with Threads and Processes
- The GIL
- Concurrency Beyond the Standard Library
- Concurrency and Scalability Beyond Python
- 20. Concurrent Executors
- Whats New in This Chapter
- Concurrent Web Downloads
- A Sequential Download Script
- Downloading with concurrent.futures
- Where Are the Futures?
- Launching Processes with concurrent.futures
- Multicore Prime Checker Redux
- Experimenting with Executor.map
- Downloads with Progress Display and Error Handling
- Error Handling in the flags2 Examples
- Using futures.as_completed
- Chapter Summary
- Further Reading
- 21. Asynchronous Programming
- Whats New in This Chapter
- A Few Definitions
- An asyncio Example: Probing Domains
- Guidos Trick to Read Asynchronous Code
- New Concept: Awaitable
- Downloading with asyncio and HTTPX
- The Secret of Native Coroutines: Humble Generators
- The All-or-Nothing Problem
- Asynchronous Context Managers
- Enhancing the asyncio Downloader
- Using asyncio.as_completed and a Thread
- Throttling Requests with a Semaphore
- Making Multiple Requests for Each Download
- Delegating Tasks to Executors
- Writing asyncio Servers
- A FastAPI Web Service
- An asyncio TCP Server
- Asynchronous Iteration and Asynchronous Iterables
- Asynchronous Generator Functions
- Experimenting with Pythons async console
- Implementing an asynchronous generator
- Asynchronous generators as context managers
- Asynchronous generators versus native coroutines
- Asynchronous Generator Functions
- Async Comprehensions and Async Generator Expressions
- Defining and using an asynchronous generator expression
- Asynchronous comprehensions
- async Beyond asyncio: Curio
- Type Hinting Asynchronous Objects
- How Async Works and How It Doesnt
- Running Circles Around Blocking Calls
- The Myth of I/O-Bound Systems
- Avoiding CPU-Bound Traps
- Chapter Summary
- Further Reading
- V. Metaprogramming
- 22. Dynamic Attributes and Properties
- Whats New in This Chapter
- Data Wrangling with Dynamic Attributes
- Exploring JSON-Like Data with Dynamic Attributes
- The Invalid Attribute Name Problem
- Flexible Object Creation with __new__
- Computed Properties
- Step 1: Data-Driven Attribute Creation
- Step 2: Property to Retrieve a Linked Record
- Step 3: Property Overriding an Existing Attribute
- Step 4: Bespoke Property Cache
- Step 5: Caching Properties with functools
- Using a Property for Attribute Validation
- LineItem Take #1: Class for an Item in an Order
- LineItem Take #2: A Validating Property
- A Proper Look at Properties
- Properties Override Instance Attributes
- Property Documentation
- Coding a Property Factory
- Handling Attribute Deletion
- Essential Attributes and Functions for Attribute Handling
- Special Attributes that Affect Attribute Handling
- Built-In Functions for Attribute Handling
- Special Methods for Attribute Handling
- Chapter Summary
- Further Reading
- 23. Attribute Descriptors
- Whats New in This Chapter
- Descriptor Example: Attribute Validation
- LineItem Take #3: A Simple Descriptor
- Terms to understand descriptors
- LineItem Take #3: A Simple Descriptor
- LineItem Take #4: Automatic Naming of Storage Attributes
- LineItem Take #5: A New Descriptor Type
- Overriding Versus Nonoverriding Descriptors
- Overriding Descriptors
- Overriding Descriptor Without __get__
- Nonoverriding Descriptor
- Overwriting a Descriptor in the Class
- Methods Are Descriptors
- Descriptor Usage Tips
- Descriptor Docstring and Overriding Deletion
- Chapter Summary
- Further Reading
- 24. Class Metaprogramming
- Whats New in This Chapter
- Classes as Objects
- type: The Built-In Class Factory
- A Class Factory Function
- Introducing __init_subclass__
- Why __init_subclass__ Cannot Configure __slots__
- Enhancing Classes with a Class Decorator
- What Happens When: Import Time Versus Runtime
- Evaluation Time Experiments
- Metaclasses 101
- How a Metaclass Customizes a Class
- A Nice Metaclass Example
- Metaclass Evaluation Time Experiment
- A Metaclass Solution for Checked
- Metaclasses in the Real World
- Modern Features Simplify or Replace Metaclasses
- Metaclasses Are Stable Language Features
- A Class Can Only Have One Metaclass
- Metaclasses Should Be Implementation Details
- A Metaclass Hack with __prepare__
- Wrapping Up
- Chapter Summary
- Further Reading
- Afterword
- Further Reading
- Index
O'Reilly Media - inne książki
-
Software as a service (SaaS) is on the path to becoming the de facto model for building, delivering, and operating software solutions. Adopting a multi-tenant SaaS model requires builders to take on a broad range of new architecture, implementation, and operational challenges. How data is partiti...(237.15 zł najniższa cena z 30 dni)
245.65 zł
289.00 zł(-15%) -
Great engineers don't necessarily make great leaders—at least, not without a lot of work. Finding your path to becoming a strong leader is often fraught with challenges. It's not easy to figure out how to be strategic, successful, and considerate while also being firm. Whether you're on the...(118.15 zł najniższa cena z 30 dni)
126.65 zł
149.00 zł(-15%) -
Data science happens in code. The ability to write reproducible, robust, scaleable code is key to a data science project's success—and is absolutely essential for those working with production code. This practical book bridges the gap between data science and software engineering,and clearl...(211.65 zł najniższa cena z 30 dni)
220.15 zł
259.00 zł(-15%) -
With the massive adoption of microservices, operators and developers face far more complexity in their applications today. Service meshes can help you manage this problem by providing a unified control plane to secure, manage, and monitor your entire network. This practical guide shows you how th...(194.65 zł najniższa cena z 30 dni)
211.65 zł
249.00 zł(-15%) -
Get practical advice on how to leverage AI development tools for all stages of code creation, including requirements, planning, design, coding, debugging, testing, and documentation. With this book, beginners and experienced developers alike will learn how to use a wide range of tools, from gener...(164.25 zł najniższa cena z 30 dni)
186.15 zł
219.00 zł(-15%) -
Rust's popularity is growing, due in part to features like memory safety, type safety, and thread safety. But these same elements can also make learning Rust a challenge, even for experienced programmers. This practical guide helps you make the transition to writing idiomatic Rust—while als...(164.25 zł najniższa cena z 30 dni)
186.15 zł
219.00 zł(-15%) -
Advance your Power BI skills by adding AI to your repertoire at a practice level. With this practical book, business-oriented software engineers and developers will learn the terminologies, practices, and strategy necessary to successfully incorporate AI into your business intelligence estate. Je...(211.65 zł najniższa cena z 30 dni)
220.15 zł
259.00 zł(-15%) -
Microservices can be a very effective approach for delivering value to your organization and to your customers. If you get them right, microservices help you to move fast by making changes to small parts of your system hundreds of times a day. But if you get them wrong, microservices will just ma...(203.15 zł najniższa cena z 30 dni)
211.65 zł
249.00 zł(-15%) -
JavaScript gives web developers great power to create rich interactive browser experiences, and much of that power is provided by the browser itself. Modern web APIs enable web-based applications to come to life like never before, supporting actions that once required browser plug-ins. Some are s...(186.15 zł najniższa cena z 30 dni)
186.15 zł
219.00 zł(-15%) -
How will software development and operations have to change to meet the sustainability and green needs of the planet? And what does that imply for development organizations? In this eye-opening book, sustainable software advocates Anne Currie, Sarah Hsu, and Sara Bergman provide a unique overview...(169.14 zł najniższa cena z 30 dni)
177.65 zł
209.00 zł(-15%)
Dzieki opcji "Druk na żądanie" do sprzedaży wracają tytuły Grupy Helion, które cieszyły sie dużym zainteresowaniem, a których nakład został wyprzedany.
Dla naszych Czytelników wydrukowaliśmy dodatkową pulę egzemplarzy w technice druku cyfrowego.
Co powinieneś wiedzieć o usłudze "Druk na żądanie":
- usługa obejmuje tylko widoczną poniżej listę tytułów, którą na bieżąco aktualizujemy;
- cena książki może być wyższa od początkowej ceny detalicznej, co jest spowodowane kosztami druku cyfrowego (wyższymi niż koszty tradycyjnego druku offsetowego). Obowiązująca cena jest zawsze podawana na stronie WWW książki;
- zawartość książki wraz z dodatkami (płyta CD, DVD) odpowiada jej pierwotnemu wydaniu i jest w pełni komplementarna;
- usługa nie obejmuje książek w kolorze.
Masz pytanie o konkretny tytuł? Napisz do nas: sklep[at]helion.pl.
Książka, którą chcesz zamówić pochodzi z końcówki nakładu. Oznacza to, że mogą się pojawić drobne defekty (otarcia, rysy, zagięcia).
Co powinieneś wiedzieć o usłudze "Końcówka nakładu":
- usługa obejmuje tylko książki oznaczone tagiem "Końcówka nakładu";
- wady o których mowa powyżej nie podlegają reklamacji;
Masz pytanie o konkretny tytuł? Napisz do nas: sklep[at]helion.pl.
Książka drukowana
Oceny i opinie klientów: Fluent Python. 2nd Edition Luciano Ramalho (0) Weryfikacja opinii następuję na podstawie historii zamówień na koncie Użytkownika umieszczającego opinię. Użytkownik mógł otrzymać punkty za opublikowanie opinii uprawniające do uzyskania rabatu w ramach Programu Punktowego.