Let's build a Python type checker in 300 lines of code.| austinhenley.com
Terminal color definition.| rich.readthedocs.io
autogen_core.models#| microsoft.github.io
Bases: Protocol| microsoft.github.io
autogen_agentchat.messages#| microsoft.github.io
autogen_agentchat.base#| microsoft.github.io
Bases: ChatAgent, ABC, ComponentBase[BaseModel]| microsoft.github.io
Hypothesis 6.x¶| hypothesis.readthedocs.io
Summary| docs.tecton.ai
Text with color / style.| rich.readthedocs.io
I’ve started writing more Python code lately (because of… AI, you know). In this post, I share the tools, libraries, configs, and other integrations I use for building production-grade Python applications following a frontend-backend architecture.| César Soto Valero
An explanation of all of Python's 100+ dunder methods and 50+ dunder attributes, including a summary of each one.| www.pythonmorsels.com
@classmethod| docs.twisted.org
Components| docs.scrapy.org
This PEP proposes adding an @override decorator to the Python type system. This will allow type checkers to prevent a class of bugs that occur when a base class changes methods that are inherited by derived classes.| Python Enhancement Proposals (PEPs)
Error codes enabled by default¶| mypy.readthedocs.io
A terminal style.| rich.readthedocs.io
A piece of text with associated style. Segments are produced by the Console render process and| rich.readthedocs.io
Bases: BaseChatAgent, Component[MultimodalWebSurferConfig]| microsoft.github.io
In the chapter on grammars, we have seen how to use grammars for very effective and efficient testing. In this chapter, we refine the previous string-based algorithm into a tree-based algorithm, which is much faster and allows for much more control over the production of fuzz inputs.The algorithm in this chapter serves as a foundation for several more techniques; this chapter thus is a "hub" in the book.Prerequisites You should know how grammar-based fuzzing works, e.g. from the chapter on gr...| www.fuzzingbook.org
In this chapter, we'll start with one of the simplest test generation techniques. The key idea of random text generation, also known as fuzzing, is to feed a string of random characters into a program in the hope to uncover failures.Prerequisites You should know fundamentals of software testing; for instance, from the chapter "Introduction to Software Testing". You should have a decent understanding of Python; for instance, from the Python tutorial.We can make these prerequisites explicit. Fi...| www.fuzzingbook.org
The [LocatorAssertions] class provides assertion methods that can be used to make assertions about the [Locator] state in the tests.| playwright.dev
Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a way to find element(s) on the page at any moment. A locator can be created with the page.locator() method.| playwright.dev
In Python, a mixin class is a class that is not intended to be used directly, but instead “mixed in” to other classes through multiple inheritance. Mixins are not really a language feature but more of a conventional pattern allowed by Python’s multiple inheritance rules. Unfortunately, adding type hints to mixin classes can be tricky because they implicitly require subclasses to fit a certain shape.| adamj.eu
In the chapter on "Mutation-Based Fuzzing", we have seen how to use extra hints – such as sample input files – to speed up test generation. In this chapter, we take this idea one step further, by providing a specification of the legal inputs to a program. Specifying inputs via a grammar allows for very systematic and efficient test generation, in particular for complex input formats. Grammars also serve as the base for configuration fuzzing, API fuzzing, GUI fuzzing, and many more.Prereq...| www.fuzzingbook.org
Feed exports| docs.scrapy.org
Python is one of the most widely adopted programming languages in the world. Yet, because of it’s ease and simplicity to just “get something working”, it’s also one of the most underappreciated. If you search for Top 10 Advanced Python Tricks on Google or any other search engine, you’ll find tons of blogs or LinkedIn articles going over trivial (but still useful) things like generators or tuples. However, as someone who’s written Python for the past 12 years, I’ve come across a ...| Edward Li's Blog
User directories¶| platformdirs.readthedocs.io
Deciphering Glyph, the blog of Glyph Lefkowitz.| blog.glyph.im
Learn how to generate structured output with the Gemini API| Google AI for Developers
The Python Domain¶| www.sphinx-doc.org
structlog Package: structlog.dev Module: Helpers that make development with structlog more pleasant. See also the narrative documentation in Console Output. structlog.testing Module: Helpers to tes...| structlog
Connect to and submit computation to a Dask cluster| distributed.dask.org
A high level console interface.| rich.readthedocs.io
Renders an auto-updating live display of any given renderable.| rich.readthedocs.io
This class implements a DBAPI-compliant interface. It is what the| www.psycopg.org
BrowserContexts provide a way to operate multiple independent browser sessions.| playwright.dev
Python is a bad fit for typical DevOps tasks.| Ilya's blog
The core component of Jinja is the Environment. It contains| jinja.palletsprojects.com
Deciphering Glyph, the blog of Glyph Lefkowitz.| blog.glyph.im
Dask futures reimplements the Python futures API so you can scale your Python futures workflow across a Dask cluster.| docs.dask.org
Wrapper for C++ torch::jit::Module with methods, attributes, and parameters.| pytorch.org
PEP 589 defines the structural type TypedDict for dictionaries with a fixed set of keys. As TypedDict is a mutable type, it is difficult to correctly annotate methods which accept read-only parameters in a way that doesn’t prevent valid inputs.| Python Enhancement Proposals (PEPs)
In my opinion, you should only introduce a named tuple to your code when you're updating a preexisting API that was already returning a tuple or you are wrapping a tuple return value from another API. Let's start with when you should use named tuples. Usually an API that returns| Tall, Snarky Canadian
October, 2024| www.bitecode.dev
Represents an HTTP request, which is usually generated in a Spider and| docs.scrapy.org
Componentize-Py is a new tool for packaging Python apps and their dependencies as WebAssembly components.| Fermyon • Experience the next wave of cloud computing.
ENOSUCHBLOG| blog.yossarian.net
A wrapper for sharding module parameters across data parallel workers.| pytorch.org
Allegory (noun) : the expression, by means of symbolic fictional figures and actions, of truths or generalizations about human existence. Everyone knows the Python programming language was invented| ntoll.org
The packaging workflow of Python has historically been a bit messy, starting with pip being just good enough, and virtualenvs being a great idea but a bit unwieldy. Installation was difficult, and tools like anaconda filled the gaps. Lately, there’s been renaissance of package tooling in Python thanks to other languages innovating in the area, inspiring and pollinating the ecosystem, improving the comfort of development. I want to present here the tools that I use to work with Python, usual...| jiby.tech
Error codes for optional checks¶| mypy.readthedocs.io
This PEP proposes a new special form, TypeIs, to allow annotating functions that can be used to narrow the type of a value, similar to the builtin isinstance(). Unlike the existing typing.TypeGuard special form, TypeIs can narrow the type in both the if...| Python Enhancement Proposals (PEPs)
Source code: Lib/types.py This module defines utility functions to assist in dynamic creation of new types. It also defines names for some object types that are used by the standard Python interpre...| Python documentation
Ghostwriter| hypothesis.readthedocs.io
Applies Batch Normalization over a 4D input.| pytorch.org
Function overloading¶| mypy.readthedocs.io
A guide to modern Python tooling with a focus on simplicity and minimalism.| cjolowicz.github.io
Source code: Lib/_collections_abc.py This module provides abstract base classes that can be used to test whether a class provides a particular interface; for example, whether it is hashable or whet...| Python documentation
I was having a conversation with another software engineer the other day and they asked for my thoughts on various programming languages and paradigms. The topic came up because I mentioned that Python3 supported Optional types which are a popular feature in many functional programming languages like Haskell, OCaml, and F#.| paulosman.me
Page provides methods to interact with a single tab in a Browser], or an [extension background page in Chromium. One [Browser] instance might have multiple [Page] instances.| playwright.dev
This article is an exploration of how to improve error handling in Go. I address here some of the issues while others are left with open questions and some ideas. And, spoiler alert, I do love error handling in Go as it is now. I don’t want to replace it with anything like exceptions, but I want to make it slightly better. I’m going to limit all solutions to what we already have in the language.| blog.orsinium.dev
Dataset First of all, we need a dataset. We could use the Reddit API but it has quite a small number of posts you can retrieve. Luckily, you can find a dump of everything from Reddit at files.pushshift.io/reddit. Let’s download a few datasets: wget https://files.pushshift.io/reddit/submissions/RS_2020-02.zst wget https://files.pushshift.io/reddit/submissions/RS_2020-03.zst Next, we need to read the data and select only subreddits and columns we’re interested in. Every dataset takes a lot ...| blog.orsinium.dev
Linters pyflakes – checks only obvious bugs and never code style. There are no opinionated checks. Pyflakes should be enabled in any project, and all errors must be fixed. pycodestyle – most important code style checker. Controls compatibility with PEP-8 that is standard de-facto for how Python code should look like. Initially, the tool was called pep8, but renamed after Guido’s request. flake8 is the most famous Python linter. First of all, it is a framework allowing you to write custo...| blog.orsinium.dev
Let’s take for example an incredibly simple code and imagine that it’s incredibly complicated logic. def cat(left, right): """Concatenate two given strings. """ return left + right Tests How can we be sure this code works? No, it’s not obvious. Remember the rules of the game, we have an incredibly complicated realization. So, we can’t say it works or not while we haven’t tested it. def test_cat(): result = cat(left='abc', right='def') assert result == 'abcdef' Now, run pytest:| blog.orsinium.dev
Base class for all neural network modules.| pytorch.org
Some hints and tips for getting started with Mypy and introducing it to existing projects| calpaterson.com
>>>, The default Python prompt of the interactive shell. Often seen for code examples which can be executed interactively in the interpreter.,,..., Can refer to:- The default Python prompt of the i...| Python documentation
Editor, Adam Turner,. This article explains the new features in Python 3.12, compared to 3.11. Python 3.12 was released on October 2, 2023. For full details, see the changelog. Summary – Release hi...| Python documentation
Pydantic is a Pythonic data validation library that makes it easy to create data models and validate data.| blog.yezz.me
TypeScript ushered in an era of gradual typing, where developers don’t have to choose between the agility of dynamic languages and the type safety of static languages, all while helping avoid the p...| GitHub
You can check out a YouTube recording of a talk based on this blog post.| Kobzol’s blog
...that were written in a military training camp and accidentally grew to 5k words| zverok.space
Allows the model to jointly attend to information from different representation subspaces.| pytorch.org
A simple statement is comprised within a single logical line. Several simple statements may occur on a single line separated by semicolons. The syntax for simple statements is: Expression statement...| Python documentation
Protocols and structural subtyping¶| mypy.readthedocs.io
Source code: Lib/functools.py The functools module is for higher-order functions: functions that act on or return other functions. In general, any callable object can be treated as a function for t...| Python documentation
Compiling Black without errors or warnings was the easy bit, now I had to optimize it for mypyc.| ichard26.github.io
I spent a COVID summer (and then some) integrating mypyc into Black to double performance. How was it?| ichard26.github.io
Using selectors| parsel.readthedocs.io
How to fail loudly when you really should| hakibenita.com
The conflict between subclassing and composition is as old as object-oriented programming. The latest crop of languages like Go or Rust prove that you don’t need subclassing to successfully write code. But what’s a pragmatic approach to subclassing in Python, specifically?| Hynek Schlawack
namedtuple has been around since forever, and over time, its convenience saw it used far outside its originally intended purpose. With dataclasses now covering part of those use cases, what should one use named tuples for? In this article, I address this question, and give a few examples from real code.| death and gravity
A simple, YAML-based tool for building and publishing AWS Lambda layers: https://github.com/jacksgt/lambda-layer-tool| Jack Henschel's Blog
tl;dr - I used a self-hosted Baserow instance as the backend for a landing page announcing my most ambitious endeavor yet (a cloud provider called NimbusWS). UPDATE (11/25/2021) Baserow 1.7 has just been released!. Lots of big features in this new release, like Lookups (which look like a way to do JOINs) -- and someting I pontificated in this very post, webhooks! Building landing pages is fun, but I always hesitate a little bit when it comes time to store the data that they collect (emails, p...| vadosware.io