#dunder-methods

[ follow ]
Python
fromRealpython
1 day ago

Implementing the Factory Method Pattern in Python Quiz - Real Python

The quiz tests understanding of the Factory Method Pattern in Python.
Python
fromInfoWorld
1 day 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.
#django
Django
fromPycoders
1 week ago

PyCoder's Weekly | Issue #728

Django projects can be improved with Alpine AJAX and friendly classes for better code quality and maintainability.
Django
fromLoopwerk
2 weeks ago

Building modern Django apps with Alpine AJAX, revisited

Simplifying the web development stack with an all-Django approach and Alpine AJAX improves efficiency and reduces unnecessary complexity.
Web frameworks
fromLoopwerk
2 months ago

Django 6.0 Tasks: a framework without a worker

Django 6.0 adds a built-in tasks framework but lacks scheduling, retries, persistence, worker processes, and a production-ready backend.
Django
fromPycoders
1 week ago

PyCoder's Weekly | Issue #728

Django projects can be improved with Alpine AJAX and friendly classes for better code quality and maintainability.
Django
fromRealpython
2 weeks ago

Getting Started With Django: Building a Portfolio App Quiz - Real Python

The quiz tests understanding of core Django concepts essential for building a portfolio app.
Django
fromLoopwerk
2 weeks ago

Building modern Django apps with Alpine AJAX, revisited

Simplifying the web development stack with an all-Django approach and Alpine AJAX improves efficiency and reduces unnecessary complexity.
Python
fromPycoders
2 days ago

PyCoder's Weekly | Issue #729

SerpApi provides structured JSON from search engines, simplifying data retrieval for AI applications.
JavaScript
fromMedium
2 weeks ago

Metaprogramming: teaching the compiler to explain your data.

Contextual information enhances debugging by providing field names, types, and nested structures.
#python
Python
fromGrahamdumpleton
1 week ago

Free Python decorator workshops - Graham Dumpleton

Interactive workshops on Python decorators are available for free, covering fundamentals to advanced topics, emphasizing hands-on learning.
Python
fromRealpython
2 weeks ago

Python Modules and Packages: An Introduction Quiz - Real Python

The quiz tests understanding of Python modules and packages through 10 questions.
Python
fromGrahamdumpleton
1 week ago

Free Python decorator workshops - Graham Dumpleton

Interactive workshops on Python decorators are available for free, covering fundamentals to advanced topics, emphasizing hands-on learning.
Python
fromRealpython
1 week ago

Python's Counter: The Pythonic Way to Count Objects Quiz - Real Python

The quiz tests understanding of Python's Counter for counting objects and performing multiset operations.
Python
fromRealpython
2 days ago

Building a Python GUI Application With Tkinter Quiz - Real Python

Test understanding of Tkinter through a 10-question interactive quiz on core widgets and application building.
Python
fromThe JetBrains Blog
3 days ago

How to Train Your First TensorFlow Model in PyCharm | The PyCharm Blog

TensorFlow is an open-source framework for building and deploying machine learning models using tensors and high-level libraries like Keras.
fromDjangocentral
2 weeks ago

DRF Serializer: Handling OrderedDict and Converting It to a Dictionary or JSON

The use of an OrderedDict ensures that the order of fields in the serialized representation matches the order of fields defined in the serializer class.
UX design
fromMedium
1 month ago

Claude Code Best Practices

Plan before executing when using Claude Code to avoid spending excessive time fixing errors and redirecting the AI toward correct solutions.
Python
fromRealpython
1 week ago

Test-Driven Development With pytest Quiz - Real Python

The quiz tests understanding of Test-Driven Development with pytest through 8 questions.
Python
fromPycoders
2 weeks ago

PyCoder's Weekly | Issue #727

Jazzband is winding down due to the overwhelming number of AI submissions affecting its cooperative model.
Django
fromRealpython
1 month ago

Introduction to Python SQL Libraries Quiz - Real Python

A 9-question interactive quiz assesses proficiency in Python SQL libraries for database connectivity, query execution, and cross-database scripting with SQLite, MySQL, and PostgreSQL.
Python
fromTalkpython
2 weeks ago

Updates from Talk Python - March 2026

Talk Python has introduced a new dashboard, volume control, and is developing a course on Python web app security and agentic AI.
fromPycoders
2 months ago

PyCoder's Weekly | Issue #720

subprocess module relies on busy-loop polling to determine whether a process has completed yet. Modern operating systems have callback mechanisms to do this, and Python 3.15 will now take advantage of these.
Web frameworks
Python
fromMouse Vs Python
6 months ago

An Intro to Python 3.14's New Features - Mouse Vs Python

Python 3.14 introduces free-threaded builds, an experimental JIT compiler, and replaces GPG signatures with Sigstore verification.
Artificial intelligence
fromRlancemartin
2 months ago

Agent design patterns

Effective autonomous agent design requires careful context engineering and providing agents with a computational environment, persistent storage, and multi-layer tool-based action spaces.
Python
fromRealpython
3 weeks ago

Exploring Basic Data Types in Python Quiz - Real Python

A 12-question interactive quiz assesses understanding of Python data types including numeric, string, and Boolean types, their representation, and built-in functions.
fromAlex MacArthur
2 months ago

I used a generator to build a replenishable queue.

Ever since writing about them, the generator in JavaScript has become my favorite hammer. I'll wield it nearly any chance I can get it. Usually, that looks like rolling through a finite batch of items over time. For example, doing something with a bunch of leap years: ...or lazily processing some files: In both examples, the pool of items is exhausted once and never replenished. The for loop stops, and the final item returned by the iterator contains done: true. C'est fini.
JavaScript
Python
fromRealpython
3 weeks ago

Build Your Weekly Python Study Schedule: 7 Days to Consistent Progress - Real Python

Create a sustainable weekly Python study schedule using three steps: clarify goals, design a realistic plan, and apply behavioral psychology to build lasting habits.
fromLoopwerk
2 months ago

Django's test runner is underrated

Readable failures. When something breaks, I want to understand why in seconds, not minutes. Predictable setup. I want to know exactly what state my tests are running against. Minimal magic. The less indirection between my test code and what's actually happening, the better. Easy onboarding. New team members should be able to write tests on day one without learning a new paradigm.
Web frameworks
fromThepythoncodingstack
1 month ago

The Journey From LBYL to EAFP * [Club]

LBYL came more naturally to me in my early years of programming. It seemed to have fewer obstacles in those early stages, fewer tricky concepts. And in my 10+ years of teaching Python, I also preferred teaching LBYL to beginners and delaying EAFP until later. But over the years, as I came to understand Python's psyche better, I gradually shifted my programming style-and then, my teaching style, too.
Software development
fromPaolo Melchiorre
1 month ago

Django ORM Standalone: Querying an existing database

For a long time I wanted to document something I have done many times in production systems but never explained clearly: using Django ORM as a standalone module to connect to an existing database. In my work I have often dealt with legacy systems where the only reliable source of truth was the database itself. In those situations, Django ORM became my Swiss army knife.
Web frameworks
fromRealpython
1 month ago

Python Descriptors: An Introduction Quiz - Real Python

By working through this quiz, you'll revisit the descriptor protocol, how .__get__() and .__set__() control attribute access, and how to implement read only descriptors. You'll also explore data vs. non-data descriptors, attribute lookup order, and the .__set_name__() method.
Python
Software development
fromMouse Vs Python
2 months ago

Python Typing Book Kickstarter - Mouse Vs Python

Python type hinting supports variable and function annotations, generics, TypedDict, decorators, and can be enforced with Mypy or ty in pre-commit or GitHub Actions.
Python
fromRealpython
4 weeks ago

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

Pydantic AI is a Python framework for building LLM agents that return validated, structured outputs using Pydantic models with automatic type safety and validation.
#fastapi
fromPybites
1 month ago
Web frameworks

How Dependency Injection Makes Your FastAPI Code Better Testable - Pybites

fromPybites
1 month ago
Web frameworks

How Dependency Injection Makes Your FastAPI Code Better Testable - Pybites

Software development
fromTreehouse Blog
2 months ago

Intermediate Python: Files, Packages, and CLI Apps

Intermediate Python enables building file-based, package-enabled, command-line programs that automate tasks, process data, and integrate into real workflows.
Python
fromRealpython
4 weeks ago

Threading in Python Quiz - Real Python

An interactive 10-question quiz assesses understanding of Python threading concepts including thread creation, ThreadPoolExecutor, locks for race condition prevention, and queue-based producer-consumer patterns.
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.
fromDjango Project
2 months ago

Recent trends in the work of the Django Security Team

We also patched two potential denial-of-service vulnerabilities when handling large, malformed inputs. One exploits inefficient string concatenation in header parsing under ASGI ( CVE 2025-14550). Concatenating strings in a loop is known to be slow, and we've done fixes in public where the impact is low. The other one ( CVE 2026-1285) exploits deeply nested entities. December's vulnerability in the XML serializer ( CVE 2025-64460) was about those very two themes.
Web frameworks
Python
fromRealpython
1 month ago

Python Gains frozendict and Other Python News for March 2026 - Real Python

Python 3.15 will include frozendict as a built-in immutable, hashable dictionary type, with PEP 814 accepted by the Steering Council in February.
Django
fromPycoders
2 months ago

PyCoder's Weekly | Issue #718

pandas 3.0 adds pd.col expressions, Copy-on-Write semantics, and PyArrow-backed strings for significantly faster, more predictable dataframe and string operations.
Software development
fromRubyflow
1 month ago

A major shift in Ruby didn't come with new syntax - it came with fewer assumptions

Cannot access external URLs; please paste the article text or excerpts so I can produce the requested structured analysis.
Python
fromRealpython
1 month ago

Working With APIs in Python: Reading Public Data - Real Python

Python with the Requests library enables efficient consumption of REST, SOAP, and GraphQL APIs through HTTP communication, supporting various authentication methods like API keys and OAuth.
Python
fromRealpython
1 month ago

Python Stacks, Queues, and Priority Queues in Practice Quiz - Real Python

An 11-question quiz tests understanding of Python stacks, queues, priority queues, and their real-world applications in traversal and system architecture.
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.
fromRealpython
1 month ago

What Does Python's __init__.py Do? - Real Python

A directory without an __init__.py file becomes a namespace package, which behaves differently from a regular package and may cause slower imports. You can use __init__.py to explicitly define a package's public API by importing specific modules or functions into the package namespace.
Python
fromRealpython
1 month ago

Episode #286: Overcoming Testing Obstacles With Python's Mock Object Library - The Real Python Podcast

Mocking in Python with unittest.mock allows you to simulate complex logic or unpredictable dependencies, such as responses from external services. The Mock class can imitate real objects, and the patch() function lets you temporarily substitute mocks for real objects in your tests.
Python
fromRealpython
1 month ago

Hands-On Python 3 Concurrency With the asyncio Module Quiz - Real Python

This quiz sharpens your intuition for Python's asyncio module. You'll decide when async is the right tool, see how the event loop schedules work, and understand how coroutines pause and resume around I/O.
Python
Python
fromRealpython
2 months ago

Intro to Object-Oriented Programming (OOP) in Python - Real Python

Object-oriented programming fundamentals in Python: defining classes, instantiating objects, and basic inheritance to write maintainable, less redundant code.
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.
Python
fromPycoders
2 months ago

PyCoder's Weekly | Issue #717

Test and monitor code performance scaling, optimize Docker builds with BuildKit cache mounts, use AI coding tools like Cursor, and apply recursive structural pattern matching.
Python
fromPycoders
1 month ago

PyCoder's Weekly | Issue #721

Text classification and compression converge via incremental compressors; Python 3.14's zstd support enables experimenting with ML through compression.
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
fromRealpython
1 month ago

Python's pathlib Module: Taming the File System Quiz - Real Python

Use Python's pathlib module to perform common filesystem operations like path joining, iteration, file creation, writing, renaming, and extracting filename components.
fromPythonbytes
2 months ago

A bolt of Django

About the show Sponsored by us! Support our work through: Connect with the hosts Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 11am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it.
Python
Python
fromTalkpython
2 months ago

diskcache: Your secret Python perf weapon

DiskCache provides a SQLite-backed, dictionary-like persistent cache that speeds Python applications, supports cross-process use, and avoids running separate services like Redis.
Python
fromRealpython
1 month ago

Improving Your Tests With the Python Mock Object Library - Real Python

unittest.mock enables creation, inspection, configuration, and substitution of mock objects to simplify testing of complex logic and unpredictable dependencies.
fromNedbatchelder
2 months ago

Testing: exceptions and caches

Kacper Borucki blogged about parameterizing exception testing, and linked to pytest docs and a StackOverflow answer with similar approaches. The common way to test exceptions is to use pytest.raises as a context manager, and have separate tests for the cases that succeed and those that fail. Instead, this approach lets you unify them. I tweaked it to this, which I think reads nicely: One parameterized test that covers both good and bad outcomes. Nice.
fromThe JetBrains Blog
1 month ago

Python Unplugged on PyTV - A Free Online Python Conference for Everyone | The PyCharm Blog

Join us on March 4th 2026, for an unforgettable, non-stop event, streamed from our studio in Amsterdam. We'll be joined live by 15 well-known and beloved speakers from Python communities around the globe, including Carol Willing, Deb Nicholson, Sheena O'Connell, Paul Everitt, Marlene Mhangami, and Carlton Gibson. They'll be speaking about topics such as core Python, AI, community, web development and data science.
Python
fromPybites
2 months ago

The Missing 66% Of Your Skillset - Pybites

Bob and I have spent many years as Python devs, and 6 years coaching with Pybites and we can safely say that being a Senior Developer is only about 1/3 Python knowledge. The other 60% is the ecosystem. It's the tooling. It's all of the tech around Python that makes you stand out from the rest. This is the biggest blind spot keeping developers stuck in Tutorial Hell. You spend hours memorising obscure library features, but you crumble when asked to configure a CI/CD pipeline.
Python
[ Load more ]