In this episode, we have special guest Paul Everitt on the show to talk about the new Python Documentary that came our last week.
Python's asyncio.gather function is great for I/O bound parallel processing. There's a simple utility function I like to use that I call gather_in_batches: async def gather_in_batches(tasks, batch_size=100, return_exceptions=False): for i in range(0, len(tasks), batch_size): batch = tasks[i:i+batch_size] for result in await asyncio.gather(*batch, return_exceptions=return_exceptions): yield result
Villager, a new penetration-testing tool linked to a suspicious China-based company and described by researchers as "Cobalt Strike's AI successor," has been downloaded about 10,000 times since its release in July. The package, published on Python Package Index, operates as a Model Context Protocol (MCP) client and integrates multiple security tools. It includes Kali Linux, which legitimate defenders use to automate penetration testing, and it contains hundreds of tools that can also be used to launch cyber attacks at scale.
This quiz helps you practice sorting dictionaries by keys, values, and custom rules in modern Python. You'll revisit how insertion order works, when to use different views, and how to rebuild sorted dictionaries. You'll also learn best practices for sorting dictionaries efficiently. For a complete overview, check out Sorting Dictionaries: Keys, Values, and More. The quiz contains 11 questions and there is no time limit. You'll get 1 point for each correct answer.
VS Code has a search & replace feature that lets you use regex to look for patterns and then reference groups in the replacement... But it lets you do something else that's really cool. Changing casing with special sequences When you are replacing groups, you can use special sequences to change the casing of the group you're inserting, according to the following table: The picture below shows an example of a search & replace operation where I looked for the text "all in one go".
When writing tests in pytest, often there's a need to set environment variables for your tests. Instead of modifying `os.environ` directly, which can lead to side effects and make tests harder to manage, here's how to do it with the [pytest-env](https://pypi.org/project/pytest-env/) package. First, install the package. ```sh pip install pytest-env # classic but works great uv add pytest-env # if you're one of us cool kids using uv uv add pytest-env --group test # if you use a specific test group of dependencies ```
I actually run from my family outdated PC a full scan in realtime of bluesky with some python code. And then later : - AppViews are actual "application backends". Bluesky operates the bsky.app appview, i.e. what people know as the Bluesky app. Importantly, in ATProto, there is no reason for everyone to run their own AppView. You can run one (and it costs about $300/mo to run a Bluesky AppView ingesting all data currently on the network in real time if you want to do that).
Ready to level up your Python code optimization skills? In this quiz, you'll revisit key concepts about profiling, benchmarking, and diagnosing performance bottlenecks. You'll practice with tools like cProfile and timeit, and see how deterministic and statistical profilers differ.
Here's how [he demonstrated](https://adamj.eu/tech/2025/07/30/python-check-package-version-importlib-metadata-version/) I should be doing it instead. ```toml # pyproject.toml [project] name = "air" version = "0.25.0" # This is the source of truth for the version number ```
The new Placeholder, added in Python 3.14, only makes sense in the context of functools.partial, so in order to understand Placeholder you will need to understand how functools.partial works and how to use it. In a nutshell, partial allows you to perform partial function application, by "freezing" arguments to functions. How to pass arguments to functools.partial Up until Python 3.13, you could use partial to freeze arguments in two types of ways: you could pass positional arguments to partial, which would be passed in the same order to the function being used with partial; or you could pass keyword arguments to partial, which would be passed with the same name to the function being used with partial.
When tackling object-oriented programming problems, one must choose between inheritance and composition, as each has distinct trade-offs. Composition often leads to more flexible and reusable code.