Ultimate Python
/
Python Versions
Fundamentals(11)
  • Variable
  • Expression
  • String
  • List
  • Tuple
  • Set
  • Dict
  • Conditional
  • Loop
  • Function
  • Comprehension
OOP(11)
  • Basic Class
  • Dataclass
  • Inheritance
  • Encapsulation
  • Property
  • Enum
  • Abstract Class
  • Exception Class
  • Iterator Class
  • Mixin
  • Mro
Data Structures(5)
  • Deque
  • Namedtuple
  • Ordereddict
  • Defaultdict
  • Heap
Standard Library(5)
  • File Handling
  • Regex
  • Data Format
  • Date Time
  • Itertools
Advanced(9)
  • Decorator
  • Context Manager
  • Meta Class
  • Weak Ref
  • Walrus Operator
  • Arg Enforcement
  • Dict Union
  • Pattern Matching
  • Template Strings
Concurrency(4)
  • Thread
  • Process
  • Async
  • Subinterpreters
Engineering(5)
  • Mocking
  • Benchmark
  • Memory Profile
  • Logger
  • Bitwise

No matching lessons found

Chapter5 Lessons

Engineering

Production code quality, benchmarking, and algorithmic tooling. Study unit test mocking, micro-benchmarking, dictionary merging, and bitwise operations.

Start Chapter: Mocking

Chapter Lessons

01

Mocking

Mocking objects is a common strategy that developers use to test code that depends on an external system or external resources for it to work properly. This module shows how to use mocking to modify an application server so that it is easier to test.

View Code
02

Benchmark

As programs increase in size, they have the risk of getting slow as new features are added and extra layers of complexity to the main features. Benchmarking is an approach that helps developers use profiling metrics and their code intuition to optimize programs further. This module uses cProfile to compare the performance of two functions with each other, showcasing the impact of caching/memoization with `functools.cache`.

View Code
03

Memory Profile

While CPU profiling (`cProfile`) identifies execution bottlenecks, memory profiling diagnoses RAM consumption, high allocations, and memory leaks.

View Code
04

Logger

Production software requires observability into application state, diagnostic events, and unexpected errors.

View Code
05

Bitwise

Bitwise operators manipulate integers at the individual bit level, serving as essential tools in systems engineering, low-level protocols, and optimization.

View Code
Previous ChapterConcurrency