Trending

#Mypy

Latest posts tagged with #Mypy on Bluesky

Latest Top
Trending

Posts tagged #Mypy

Preview
Vercel Just Proposed a TypeScript-Inspired Upgrade to Python's Type System Vercel engineers spent a year building PEP 827 — a proposal that could give Python the programmable type system TypeScript developers have always taken for granted.

Vercel Just Proposed a TypeScript-Inspired Upgrade to Python's Type System

techlife.blog/posts/vercel...

#Python #TypeScript #PEP827 #Vercel #Typing #FastAPI #Pydantic #Mypy

2 0 0 0
Original post on mastodon.nu

Is there any way linter/type checker for #Python that can find expressions that never will evaluate to anything other than False based on the type information? E.g. checking if a variable of the type `int` exists within a list of the type `liststr]`? I do use [#mypy but it doesn't seem to catch […]

0 2 1 0

With high-performance #Python type checkers like #Pyright, #Pyrefly, and #ty now available, what's the value proposition of #Mypy? Is it the reference implementation? Or does Mypy still have the most features? I'm not trying to knock Mypy, I'm genuinely asking because I don't know.

1 1 1 0
Post image

The results of the 2025 Python Typing Survey are in!

📈 86% of developers rely on type hints regularly
🛠️ #Mypy, #Pyright / #Pylance, and #Pydantic are the most used type-checking tools
✨ Top benefits: better IDE support, bug prevention, and documentation

Find more stats in this thread ⬇️

2 0 4 0

I've leveraged Antigravity and the Claude and Gemini models to create a #mypy plugin to signal a function as free of side-effects. The development has been much faster! Check it out!
github.com/diegojromero...

0 0 0 0

Mixed feelings about typing everything and using mypy. It finds alot of possible bugs and problems, but it takes the lightness out of my programming.
#python #pythondev #mypy

3 0 0 0
Automatically generated documentation

Automatically generated documentation

have you ever annotated a TypedDict onto the **kwargs fuction and want Sphinx to automatically add it to the function's docstring?

class GreetingKwargs(TypedDict):
name: Annotated[str, Doc("the name of the person to greet")]

def greet(**kwargs […]

[Original post on scholar.social]

0 2 1 0
Preview
Namespace vs Regular Packages in Python — And Why mypy Might Be Failing You If you're building AI systems, data pipelines, or backend services in Python, you’ve probably run into weird bugs with mypy not picking up types or imports mysteriously failing—especially when you’re working across microservices or large codebases. Chances are… you’re using a namespace package (maybe without even knowing it). Let’s break it down. 📦 Regular Packages vs Namespace Packages Regular Packages Require an **init**.py file Define a single, self-contained folder Easy for mypy, IDEs, linters, and tests to process # Regular package project/ └── analytics/ ├── **init**.py ├── metrics.py └── models.py Namespace Packages No **init**.py needed Split across multiple folders/repos Used in plugin systems or modular AI/ML tooling # Namespace package src/coretools/featurestore/ encoder.py libs/featurestore/ scaler.py With namespace packages, coretools.featurestore.encoder and libs.featurestore.scaler can coexist under the same import path. 👉 Great for scalability. Nightmare for static analysis—unless configured right. 🧪 Why AI Devs & Data Teams Should Care 🔌 Modular Pipelines: When your training logic and feature store live in different repos 🧩 Plugin Systems: For experiment tracking, custom metrics, preprocessing layers 🧠 Shared AI Tooling: Across internal libraries, you may already be “namespacing” without realizing But here's the catch… 🚨 Why mypy Can Break on Namespace Packages ✅ Your Developer Checklist to Fix mypy with Namespace Packages Enable namespace support mypy --namespace-packages Or in mypy.ini: [mypy] namespace_packages = true Use p your.package.name instead of just the folder mypy -p featurestore.encoder Set MYPYPATH + -explicit-package-bases if your source layout is non-standard export MYPYPATH=src mypy --explicit-package-bases -p yourpkg.module Still struggling? Add dummy **init**.pyi or **init**.py This helps tools infer structure even in namespace packages. 🧾 Summary Table “Namespaces are one honking great idea — let's do more of those.” 🔍 TakeAway If you're building modular AI pipelines, ML services, or shared tooling across teams—you need to understand how namespace packages and tools like mypy interact. It's the difference between silent bugs and confident code. Have you hit these issues in production or CI? Let’s compare notes 👇
0 0 0 0
Post image Post image Post image

Most of us already got used to annotate our #python code with typehints. If I had to guess, I would say that most people are using #mypy for checking the types.

Did you know that other checkers have emerged these days?

2 0 1 0

#pyright is better than #mypy out of the box.

0 0 0 0
Preview
Python Type Hints: How to Gradually Add Types for Third Party Packages - Adam Johnson Hynek Schlawack recently described graduality as Python’s super power: the ability to prototype in the REPL, and gradually add linting, type checking, and other practices to refine your code into main...

I’m busy re-applying this “gradual import” technique on a client project today. Will slowly get them up to a full django-stubs installation.

#Python #MyPy

adamj.eu/tech/2022/08...

6 1 0 0

Been playing with Wagtail CMS, tutorials are super nice to follow. But I got to the point where I decided to add #mypy to the project and had to go through and figure out the #TypeAnnotaions for the functions. Anyone else wish #Python projects had type annotations in their docs?

1 0 0 0

#MyPy + #Pydantic is fucking awesome. It's like TypeScript but nicer. Cannot wait for my dependencies to let me upgrade from 3.10 so I can enjoy even more tomfoolery

If you're using #Python without it, esp. for science, you're missing out!

2 0 0 0

Hey all! Excited to re-introduce myself. I'm Emma. I like to talk about:
- #python 🐍
- #rust 🦀
- #types 🌯
- #packaging 📦
- #webassembly 🌐
- #quantum computing ⚛️

I'm an emeritus core developer on the #mypy project (still happy to answer questions!), and I contribute to CPython from time to time.

45 0 3 0

When you add #mypy typing to a #python function, you lose the monkey from the signature, so use the emoji one.

`def do_it():`
becomes
`def do_it()->None: # 🐵`

0 0 0 0

Sim, tou usando #mypy ... valews pelos improvements ai mano!

0 0 0 0

If you want to disable multiple error codes in single line comment for entire file, using mypy, here's how:

```
# mypy: disable-error-code="override,misc"
```

#python #mypy

0 0 0 0
Uncompiled development version

Uncompiled development version

Compiled mypy

Compiled mypy

TIL: mypy is compiled by default with mypyc, for incredible (almost 3x) speed boost.

#python #mypy

0 0 0 0
Preview
Types at the edges in Python Adding more strict typing around the edges of a python system for better error messages and design.

Types at the edges in #Python with #mypy and #pydantic blog.meadsteve.dev/programming/2020/02/10/t...

0 0 0 0

I don't know why, but adding #mypy type hints to an existing mid-side project was some of the most fun I've had while doing #Python refactoring. There's a magical point on the coverage curve where suddenly everything clicks into place and "just works". 1/3

0 0 1 0

How Mypy could simplify compiling Python http://lnk.al/3m5F via @infoworld #Mypy #Python

0 0 0 0

Basically, #mypy was nicked from http://www.squarepie.co.uk/Pies right? pie in a box? been done before.

0 0 0 0