Skip to content

PEP 835: Refined rationale and ecosystem statistics - #5098

Open
till-varoquaux wants to merge 1 commit into
python:mainfrom
till-varoquaux:feature/pep-835-update
Open

PEP 835: Refined rationale and ecosystem statistics#5098
till-varoquaux wants to merge 1 commit into
python:mainfrom
till-varoquaux:feature/pep-835-update

Conversation

@till-varoquaux

@till-varoquaux till-varoquaux commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

This PR updates PEP 835 based on discourse feedback, adding metrics from the ecosystem migration.

@read-the-docs-community

read-the-docs-community Bot commented Aug 16, 2026

Copy link
Copy Markdown

Documentation build overview

📚 pep-previews | 🛠️ Build #34181894 | 📁 Comparing d7097ca against latest (29cc60d)

  🔍 Preview build  

2 files changed
± pep-0764/index.html
± pep-0835/index.html

@till-varoquaux

Copy link
Copy Markdown
Contributor Author

After this, I think we'll be done for a review by the typing council.

@ilevkivskyi ilevkivskyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG, thanks! I have just one question to clarify.

Comment thread peps/pep-0835.rst Outdated
* **SQLAlchemy:** 280 LOCs
* **cattrs:** 153 LOCs
* **Hypothesis:** 13 LOCs
* **Beartype:** 10 LOCs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does these number include adding __rmatmul__ so that None @ <smth> will work?

@till-varoquaux till-varoquaux Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the PEP to include the __rmatmul__ cost in the totals. Adding the fallback requires exactly two lines of code per metadata base class:

def __rmatmul__(self, typ: Any) -> Any:
    return Annotated[typ, self]

Here is the exact breakdown of the added lines:

  • Pydantic: +8 LOCs (added to 4 metadata classes)
  • SQLAlchemy, Hypothesis, Beartype, cattrs: +2 LOCs each
  • FastAPI: +0 LOCs (inherits from Pydantic)

The ecosystem totals in the PEP now fully reflect this. Thanks for catching this.

@till-varoquaux
till-varoquaux force-pushed the feature/pep-835-update branch from 0c2c78d to b1af947 Compare August 22, 2026 03:35
- Move Format.TYPE to Rejected Ideas
- Update formatting to '@ annot' throughout
- Refine __rmatmul__ language to encourage it as a robust fallback
- Integrate Annotated usage and migration stats
@till-varoquaux
till-varoquaux force-pushed the feature/pep-835-update branch from b1af947 to d7097ca Compare August 22, 2026 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants