#namedtuple-typing

[ follow ]
Python
fromInfoWorld
5 days ago

Get started with Python's new frozendict type

Python 3.15 introduces frozendict, an immutable dictionary that is hashable and useful in scenarios where regular dictionaries cannot be used.
Python
fromRealpython
5 days ago

Implementing the Factory Method Pattern in Python Quiz - Real Python

The quiz tests understanding of the Factory Method Pattern in Python.
#python
Python
fromInfoWorld
2 weeks ago

Speed boost your Python programs with new lazy imports

Lazy imports in Python create a proxy object that delays the actual import until the module is needed.
Python
fromRealpython
1 month ago

Pydantic AI: Build Type-Safe LLM Agents in Python Quiz - Real Python

An interactive quiz assesses knowledge of Pydantic AI, covering type-safe LLM agents, model providers, structured outputs, tool registration, dependency injection, and production trade-offs.
Python
fromRealpython
1 month ago

Duck Typing in Python: Writing Flexible and Decoupled Code Quiz - Real Python

An interactive quiz assesses understanding of duck typing in Python, covering its definition, advantages, disadvantages, behavior-based interfaces, protocols, special methods, and alternative approaches.
Python
fromPythonmorsels
2 months ago

All iteration is the same in Python

All Python iteration forms use the same iterator protocol; iterating over an object yields its defined iteration items (e.g., dictionary yields keys, string yields characters).
Python
fromInfoWorld
2 months ago

CPython vs. PyPy: Which Python runtime has the better JIT?

PyPy remains far faster for raw numerical workloads, but CPython's new native JIT and no-GIL builds close the gap in other workloads and enable threading.
Python
fromThepythoncodingstack
2 months ago

Planning Meals, Weekly Shop, Alternative Constructors Using Class Methods

Use alternative constructors via class methods to build Meal and WeeklyMealPlanner objects and protect internal state with read-only properties and shallow copies.
[ Load more ]