Skip to content

[ty] Add support for dynamic type() classes#22291

Merged
charliermarsh merged 6 commits intomainfrom
charlie/dyn
Jan 12, 2026
Merged

[ty] Add support for dynamic type() classes#22291
charliermarsh merged 6 commits intomainfrom
charlie/dyn

Conversation

@charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Dec 29, 2025

Summary

This PR adds support for dynamic classes created via type(). The core of the change is that ClassLiteral is now an enum:

pub enum ClassLiteral<'db> {
    /// A class defined via a `class` statement.
    Stmt(StmtClassLiteral<'db>),
    /// A class created via the functional form `type(name, bases, dict)`.
    Functional(FunctionalClassLiteral<'db>),
}

And, in turn, various methods on ClassLiteral like body_scope now return Option or similar (and callers must adjust to that change in signature).

Over time, we can expand the enum to include functional namedtuples, etc. (I already have this working in a separate branch, and I believe it slots in well.)

(I'd love help with the names -- I think StmtClassLiteral is kind of lame. Maybe DeclarativeClassLiteral?)

Closes astral-sh/ty#740.

@charliermarsh charliermarsh added the ty Multi-file analysis & type inference label Dec 29, 2025
@charliermarsh
Copy link
Member Author

(Not ready for review.)

@astral-sh-bot
Copy link

astral-sh-bot bot commented Dec 29, 2025

Diagnostic diff on typing conformance tests

No changes detected when running ty on typing conformance tests ✅

@astral-sh-bot
Copy link

astral-sh-bot bot commented Dec 29, 2025

mypy_primer results

Changes were detected when running on open source projects
pyp (https://github.com/hauntsaninja/pyp)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 6 diagnostics
+ Found 5 diagnostics

bidict (https://github.com/jab/bidict)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
+ bidict/_base.py:147:47: warning[unsupported-dynamic-base] Unsupported class base: Has type `type[BT@_make_inv_cls]`

more-itertools (https://github.com/more-itertools/more-itertools)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 36 diagnostics
+ Found 35 diagnostics

zipp (https://github.com/jaraco/zipp)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 5 diagnostics
+ Found 4 diagnostics

mypy_primer (https://github.com/hauntsaninja/mypy_primer)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 4 diagnostics
+ Found 3 diagnostics

git-revise (https://github.com/mystor/git-revise)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 2 diagnostics
+ Found 1 diagnostic

attrs (https://github.com/python-attrs/attrs)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 628 diagnostics
+ Found 627 diagnostics

pegen (https://github.com/we-like-parsers/pegen)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 49 diagnostics
+ Found 48 diagnostics

dacite (https://github.com/konradhalas/dacite)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 23 diagnostics
+ Found 22 diagnostics

aioredis (https://github.com/aio-libs/aioredis)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 31 diagnostics
+ Found 30 diagnostics

packaging (https://github.com/pypa/packaging)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 24 diagnostics
+ Found 23 diagnostics

janus (https://github.com/aio-libs/janus)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 4 diagnostics
+ Found 3 diagnostics

anyio (https://github.com/agronholm/anyio)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 94 diagnostics
+ Found 93 diagnostics

com2ann (https://github.com/ilevkivskyi/com2ann)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 11 diagnostics
+ Found 10 diagnostics

parso (https://github.com/davidhalter/parso)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 200 diagnostics
+ Found 199 diagnostics

paroxython (https://github.com/laowantong/paroxython)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 9 diagnostics
+ Found 8 diagnostics

python-chess (https://github.com/niklasf/python-chess)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 6 diagnostics
+ Found 5 diagnostics

nionutils (https://github.com/nion-software/nionutils)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 24 diagnostics
+ Found 23 diagnostics

pyinstrument (https://github.com/joerick/pyinstrument)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 44 diagnostics
+ Found 43 diagnostics

kornia (https://github.com/kornia/kornia)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 326 diagnostics
+ Found 324 diagnostics

pytest-robotframework (https://github.com/detachhead/pytest-robotframework)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 173 diagnostics
+ Found 172 diagnostics

async-utils (https://github.com/mikeshardmind/async-utils)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 10 diagnostics
+ Found 9 diagnostics

python-sop (https://gitlab.com/dkg/python-sop)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 2 diagnostics
+ Found 1 diagnostic

DateType (https://github.com/glyph/DateType)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 9 diagnostics
+ Found 8 diagnostics

itsdangerous (https://github.com/pallets/itsdangerous)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 3 diagnostics
+ Found 2 diagnostics

pip (https://github.com/pypa/pip)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 604 diagnostics
+ Found 603 diagnostics

spack (https://github.com/spack/spack)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
+ lib/spack/spack/builder.py:134:17: warning[unsupported-dynamic-base] Unsupported class base: Has type `type[Self@__init__]`
- lib/spack/spack/test/packages.py:417:9: error[unresolved-attribute] Object of type `type` has no attribute `name`
- Found 4319 diagnostics
+ Found 4318 diagnostics

asynq (https://github.com/quora/asynq)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 218 diagnostics
+ Found 217 diagnostics

yarl (https://github.com/aio-libs/yarl)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 47 diagnostics
+ Found 46 diagnostics

bandersnatch (https://github.com/pypa/bandersnatch)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 81 diagnostics
+ Found 80 diagnostics

stone (https://github.com/dropbox/stone)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 253 diagnostics
+ Found 252 diagnostics

websockets (https://github.com/aaugustin/websockets)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 35 diagnostics
+ Found 34 diagnostics

jinja (https://github.com/pallets/jinja)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 181 diagnostics
+ Found 180 diagnostics

werkzeug (https://github.com/pallets/werkzeug)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- src/werkzeug/test.py:815:32: error[invalid-assignment] Object of type `type` is not assignable to `type[Response] | None`
+ src/werkzeug/test.py:817:32: warning[unsupported-dynamic-base] Unsupported class base: Has type `type[Response] & ~type[TestResponse]`
- Found 387 diagnostics
+ Found 386 diagnostics

paasta (https://github.com/yelp/paasta)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 1103 diagnostics
+ Found 1102 diagnostics

isort (https://github.com/pycqa/isort)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 36 diagnostics
+ Found 35 diagnostics

twine (https://github.com/pypa/twine)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 10 diagnostics
+ Found 9 diagnostics

black (https://github.com/psf/black)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 55 diagnostics
+ Found 54 diagnostics

python-htmlgen (https://github.com/srittau/python-htmlgen)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 26 diagnostics
+ Found 25 diagnostics

boostedblob (https://github.com/hauntsaninja/boostedblob)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 22 diagnostics
+ Found 21 diagnostics

pytest (https://github.com/pytest-dev/pytest)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- src/_pytest/_py/error.py:78:13: error[invalid-assignment] Invalid subscript assignment with key of type `int` and value of type `type` on object of type `dict[int, type[Error]]`
- src/_pytest/_py/error.py:79:20: error[invalid-return-type] Return type does not match returned value: expected `type[Error]`, found `type`
- Found 426 diagnostics
+ Found 423 diagnostics

aiortc (https://github.com/aiortc/aiortc)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 195 diagnostics
+ Found 194 diagnostics

pyjwt (https://github.com/jpadilla/pyjwt)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 38 diagnostics
+ Found 37 diagnostics

pylint (https://github.com/pycqa/pylint)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 217 diagnostics
+ Found 216 diagnostics

kopf (https://github.com/nolar/kopf)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 268 diagnostics
+ Found 267 diagnostics

dulwich (https://github.com/dulwich/dulwich)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 232 diagnostics
+ Found 231 diagnostics

starlette (https://github.com/encode/starlette)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 217 diagnostics
+ Found 216 diagnostics

graphql-core (https://github.com/graphql-python/graphql-core)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 641 diagnostics
+ Found 640 diagnostics

beartype (https://github.com/beartype/beartype)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 498 diagnostics
+ Found 497 diagnostics

ignite (https://github.com/pytorch/ignite)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 2037 diagnostics
+ Found 2036 diagnostics

scrapy (https://github.com/scrapy/scrapy)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 1786 diagnostics
+ Found 1785 diagnostics

downforeveryone (https://github.com/rpdelaney/downforeveryone)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 6 diagnostics
+ Found 5 diagnostics

httpx-caching (https://github.com/johtso/httpx-caching)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 28 diagnostics
+ Found 27 diagnostics

mypy-protobuf (https://github.com/dropbox/mypy-protobuf)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 449 diagnostics
+ Found 448 diagnostics

flake8-pyi (https://github.com/PyCQA/flake8-pyi)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 3 diagnostics
+ Found 2 diagnostics

alerta (https://github.com/alerta/alerta)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 556 diagnostics
+ Found 555 diagnostics

rich (https://github.com/Textualize/rich)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 346 diagnostics
+ Found 345 diagnostics

dedupe (https://github.com/dedupeio/dedupe)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 53 diagnostics
+ Found 52 diagnostics

sockeye (https://github.com/awslabs/sockeye)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 417 diagnostics
+ Found 416 diagnostics

check-jsonschema (https://github.com/python-jsonschema/check-jsonschema)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 28 diagnostics
+ Found 27 diagnostics

pylox (https://github.com/sco1/pylox)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 49 diagnostics
+ Found 48 diagnostics

porcupine (https://github.com/Akuli/porcupine)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 19 diagnostics
+ Found 18 diagnostics

mkosi (https://github.com/systemd/mkosi)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 78 diagnostics
+ Found 77 diagnostics

PyGithub (https://github.com/PyGithub/PyGithub)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 300 diagnostics
+ Found 299 diagnostics

ppb-vector (https://github.com/ppb/ppb-vector)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 22 diagnostics
+ Found 21 diagnostics

flake8 (https://github.com/pycqa/flake8)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 39 diagnostics
+ Found 38 diagnostics

aiohttp-devtools (https://github.com/aio-libs/aiohttp-devtools)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
+ tests/test_runserver_logs.py:17:27: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `logging.Logger`, found `tests.test_runserver_logs.<locals of function 'test_aiohttp_std'>.Logger`
+ tests/test_runserver_logs.py:39:27: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `logging.Logger`, found `tests.test_runserver_logs.<locals of function 'test_aiohttp_debugtoolbar'>.Logger`
+ tests/test_runserver_logs.py:61:30: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `logging.Logger`, found `tests.test_runserver_logs.<locals of function 'test_aux_logger'>.Logger`
+ tests/test_runserver_logs.py:84:30: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `logging.Logger`, found `tests.test_runserver_logs.<locals of function 'test_aux_logger_livereload'>.Logger`
+ tests/test_runserver_logs.py:99:27: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `logging.Logger`, found `tests.test_runserver_logs.<locals of function 'test_extra'>.Logger`
- Found 31 diagnostics
+ Found 35 diagnostics

pybind11 (https://github.com/pybind/pybind11)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 217 diagnostics
+ Found 216 diagnostics

PyWinCtl (https://github.com/Kalmat/PyWinCtl)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 32 diagnostics
+ Found 31 diagnostics

poetry (https://github.com/python-poetry/poetry)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 979 diagnostics
+ Found 978 diagnostics

imagehash (https://github.com/JohannesBuchner/imagehash)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 11 diagnostics
+ Found 10 diagnostics

schemathesis (https://github.com/schemathesis/schemathesis)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 279 diagnostics
+ Found 278 diagnostics

tornado (https://github.com/tornadoweb/tornado)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- tornado/gen.py:255:62: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `None | Awaitable[Unknown] | list[Awaitable[Unknown]] | dict[Any, Awaitable[Unknown]] | Future[Unknown]`, found `_T@next | _T@next | _VT@next`
+ tornado/gen.py:255:62: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `None | Awaitable[Unknown] | list[Awaitable[Unknown]] | dict[Any, Awaitable[Unknown]] | Future[Unknown]`, found `_T@next | _VT@next | _T@next`
- Found 329 diagnostics
+ Found 328 diagnostics

nox (https://github.com/wntrblm/nox)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 25 diagnostics
+ Found 24 diagnostics

cki-lib (https://gitlab.com/cki-project/cki-lib)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 241 diagnostics
+ Found 240 diagnostics

optuna (https://github.com/optuna/optuna)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 578 diagnostics
+ Found 577 diagnostics

dragonchain (https://github.com/dragonchain/dragonchain)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 437 diagnostics
+ Found 436 diagnostics

vision (https://github.com/pytorch/vision)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 1410 diagnostics
+ Found 1409 diagnostics

mitmproxy (https://github.com/mitmproxy/mitmproxy)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 2147 diagnostics
+ Found 2146 diagnostics

alectryon (https://github.com/cpitclaudel/alectryon)
+ All checks passed!
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 1 diagnostic

urllib3 (https://github.com/urllib3/urllib3)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 307 diagnostics
+ Found 306 diagnostics

typeshed-stats (https://github.com/AlexWaygood/typeshed-stats)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 15 diagnostics
+ Found 14 diagnostics

mypy (https://github.com/python/mypy)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 1741 diagnostics
+ Found 1740 diagnostics

artigraph (https://github.com/artigraph/artigraph)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 150 diagnostics
+ Found 149 diagnostics

pandera (https://github.com/pandera-dev/pandera)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
+ pandera/api/dataframe/model.py:306:55: warning[unsupported-dynamic-base] Unsupported class base: Has type `type[Self@__class_getitem__] & <Protocol with members '__parameters__'>`
- pandera/api/dataframe/model.py:308:16: error[invalid-return-type] Return type does not match returned value: expected `type[Self@__class_getitem__]`, found `type`
+ pandera/api/dataframe/model.py:308:16: error[invalid-return-type] Return type does not match returned value: expected `type[Self@__class_getitem__]`, found `<class '<unknown>'>`
+ pandera/api/pyspark/model.py:211:55: warning[unsupported-dynamic-base] Unsupported class base: Has type `type[Self@__class_getitem__] & <Protocol with members '__parameters__'>`
- pandera/api/pyspark/model.py:213:16: error[invalid-return-type] Return type does not match returned value: expected `type[Self@__class_getitem__]`, found `type`
+ pandera/api/pyspark/model.py:213:16: error[invalid-return-type] Return type does not match returned value: expected `type[Self@__class_getitem__]`, found `<class '<unknown>'>`
- Found 1579 diagnostics
+ Found 1580 diagnostics

antidote (https://github.com/Finistere/antidote)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 248 diagnostics
+ Found 247 diagnostics

schema_salad (https://github.com/common-workflow-language/schema_salad)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 244 diagnostics
+ Found 243 diagnostics

Expression (https://github.com/cognitedata/Expression)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 206 diagnostics
+ Found 205 diagnostics

psycopg (https://github.com/psycopg/psycopg)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
+ psycopg/psycopg/types/json.py:140:26: warning[unsupported-dynamic-base] Unsupported class base: Has type `type[Loader]`

pydantic (https://github.com/pydantic/pydantic)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 3160 diagnostics
+ Found 3159 diagnostics

xarray-dataclasses (https://github.com/astropenguin/xarray-dataclasses)
+ All checks passed!
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 1 diagnostic

koda-validate (https://github.com/keithasaurus/koda-validate)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 406 diagnostics
+ Found 405 diagnostics

comtypes (https://github.com/enthought/comtypes)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 401 diagnostics
+ Found 400 diagnostics

pyppeteer (https://github.com/pyppeteer/pyppeteer)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 88 diagnostics
+ Found 87 diagnostics

operator (https://github.com/canonical/operator)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 133 diagnostics
+ Found 132 diagnostics

Tanjun (https://github.com/FasterSpeeding/Tanjun)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- tanjun/dependencies/data.py:347:12: error[invalid-return-type] Return type does not match returned value: expected `_T@cached_inject`, found `Coroutine[Any, Any, _T@cached_inject | Coroutine[Any, Any, _T@cached_inject]] | _T@cached_inject`
+ tanjun/dependencies/data.py:347:12: error[invalid-return-type] Return type does not match returned value: expected `_T@cached_inject`, found `_T@cached_inject | Coroutine[Any, Any, _T@cached_inject | Coroutine[Any, Any, _T@cached_inject]]`
- Found 135 diagnostics
+ Found 134 diagnostics

freqtrade (https://github.com/freqtrade/freqtrade)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 682 diagnostics
+ Found 681 diagnostics

build (https://github.com/pypa/build)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 50 diagnostics
+ Found 49 diagnostics

pyproject-metadata (https://github.com/pypa/pyproject-metadata)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 5 diagnostics
+ Found 4 diagnostics

sphinx (https://github.com/sphinx-doc/sphinx)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 346 diagnostics
+ Found 345 diagnostics

speedrun.com_global_scoreboard_webapp (https://github.com/Avasam/speedrun.com_global_scoreboard_webapp)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 29 diagnostics
+ Found 28 diagnostics

trio (https://github.com/python-trio/trio)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 483 diagnostics
+ Found 482 diagnostics

discord.py (https://github.com/Rapptz/discord.py)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 549 diagnostics
+ Found 548 diagnostics

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 448 diagnostics
+ Found 447 diagnostics

mkdocs (https://github.com/mkdocs/mkdocs)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 225 diagnostics
+ Found 224 diagnostics

cibuildwheel (https://github.com/pypa/cibuildwheel)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 29 diagnostics
+ Found 28 diagnostics

zope.interface (https://github.com/zopefoundation/zope.interface)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 422 diagnostics
+ Found 421 diagnostics

svcs (https://github.com/hynek/svcs)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 11 diagnostics
+ Found 10 diagnostics

arviz (https://github.com/arviz-devs/arviz)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 59 diagnostics
+ Found 58 diagnostics

pyodide (https://github.com/pyodide/pyodide)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 936 diagnostics
+ Found 935 diagnostics

meson (https://github.com/mesonbuild/meson)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 2155 diagnostics
+ Found 2154 diagnostics

rclip (https://github.com/yurijmikhalevich/rclip)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 14 diagnostics
+ Found 13 diagnostics

cloud-init (https://github.com/canonical/cloud-init)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 1180 diagnostics
+ Found 1179 diagnostics

apprise (https://github.com/caronc/apprise)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 2648 diagnostics
+ Found 2647 diagnostics

cwltool (https://github.com/common-workflow-language/cwltool)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 258 diagnostics
+ Found 257 diagnostics

xarray (https://github.com/pydata/xarray)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 1762 diagnostics
+ Found 1761 diagnostics

django-test-migrations (https://github.com/wemake-services/django-test-migrations)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 3 diagnostics
+ Found 2 diagnostics

manticore (https://github.com/trailofbits/manticore)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 11070 diagnostics
+ Found 11069 diagnostics

openlibrary (https://github.com/internetarchive/openlibrary)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 1157 diagnostics
+ Found 1156 diagnostics

setuptools (https://github.com/pypa/setuptools)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
+ setuptools/tests/test_editable_install.py:1206:53: error[unresolved-attribute] Object of type `SimulatedErr` has no attribute `__notes__`
- setuptools/tests/test_editable_install.py:1204:24: error[invalid-argument-type] Argument to function `raises` is incorrect: Argument type `object` does not satisfy upper bound `BaseException` of type variable `E`
- setuptools/tests/test_editable_install.py:1204:24: error[invalid-argument-type] Argument to function `raises` is incorrect: Expected `type[BaseException] | tuple[type[BaseException], ...]`, found `type`
- Found 1267 diagnostics
+ Found 1265 diagnostics

strawberry (https://github.com/strawberry-graphql/strawberry)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
+ strawberry/types/base.py:341:50: warning[unused-ignore-comment] Unused blanket `type: ignore` directive

prefect (https://github.com/PrefectHQ/prefect)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- src/prefect/deployments/runner.py:795:70: warning[possibly-missing-attribute] Attribute `__name__` may be missing on object of type `Unknown | ((...) -> Any)`
+ src/prefect/deployments/runner.py:795:70: warning[possibly-missing-attribute] Attribute `__name__` may be missing on object of type `Unknown | (((...) -> Any) & ((*args: object, **kwargs: object) -> object))`
- src/prefect/flow_engine.py:812:32: error[invalid-await] `Unknown | R@FlowRunEngine | Coroutine[Any, Any, R@FlowRunEngine]` is not awaitable
- src/prefect/flow_engine.py:1401:24: error[invalid-await] `Unknown | R@AsyncFlowRunEngine | Coroutine[Any, Any, R@AsyncFlowRunEngine]` is not awaitable
- src/prefect/flow_engine.py:1482:43: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Unknown | R@run_generator_flow_sync`
- src/prefect/flow_engine.py:1490:21: warning[possibly-missing-attribute] Attribute `throw` may be missing on object of type `Unknown | R@run_generator_flow_sync`
- src/prefect/flow_engine.py:1524:44: warning[possibly-missing-attribute] Attribute `__anext__` may be missing on object of type `Unknown | R@run_generator_flow_async`
- src/prefect/flow_engine.py:1531:25: warning[possibly-missing-attribute] Attribute `throw` may be missing on object of type `Unknown | R@run_generator_flow_async`
- src/prefect/flows.py:286:34: error[unresolved-attribute] Object of type `(**P@Flow) -> R@Flow` has no attribute `__name__`
+ src/prefect/flows.py:286:34: error[unresolved-attribute] Object of type `((**P@Flow) -> R@Flow) & ((*args: object, **kwargs: object) -> object)` has no attribute `__name__`
- src/prefect/flows.py:404:68: error[unresolved-attribute] Object of type `(**P@Flow) -> R@Flow` has no attribute `__name__`
+ src/prefect/flows.py:404:68: error[unresolved-attribute] Object of type `((**P@Flow) -> R@Flow) & ((*args: object, **kwargs: object) -> object)` has no attribute `__name__`
+ src/prefect/flows.py:1750:53: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- Found 5375 diagnostics
+ Found 5369 diagnostics

archinstall (https://github.com/archlinux/archinstall)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 58 diagnostics
+ Found 57 diagnostics

hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 522 diagnostics
+ Found 521 diagnostics

scipy-stubs (https://github.com/scipy/scipy-stubs)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 1235 diagnostics
+ Found 1232 diagnostics

numpy-stl (https://github.com/WoLpH/numpy-stl)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 23 diagnostics
+ Found 22 diagnostics

dd-trace-py (https://github.com/DataDog/dd-trace-py)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 8436 diagnostics
+ Found 8435 diagnostics

scikit-build-core (https://github.com/scikit-build/scikit-build-core)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- src/scikit_build_core/build/wheel.py:99:20: error[no-matching-overload] No overload of bound method `__init__` matches arguments
- Found 49 diagnostics
+ Found 47 diagnostics

pwndbg (https://github.com/pwndbg/pwndbg)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 2039 diagnostics
+ Found 2038 diagnostics

pycryptodome (https://github.com/Legrandin/pycryptodome)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 1322 diagnostics
+ Found 1321 diagnostics

aiohttp (https://github.com/aio-libs/aiohttp)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 181 diagnostics
+ Found 180 diagnostics

AutoSplit (https://github.com/Toufool/AutoSplit)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 64 diagnostics
+ Found 63 diagnostics

egglog-python (https://github.com/egraphs-good/egglog-python)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 1486 diagnostics
+ Found 1485 diagnostics

scikit-learn (https://github.com/scikit-learn/scikit-learn)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 2436 diagnostics
+ Found 2435 diagnostics

altair (https://github.com/vega/altair)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 1062 diagnostics
+ Found 1061 diagnostics

CPython (Argument Clinic) (https://github.com/python/cpython)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 22 diagnostics
+ Found 21 diagnostics

cryptography (https://github.com/pyca/cryptography)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 37 diagnostics
+ Found 36 diagnostics

django-stubs (https://github.com/typeddjango/django-stubs)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 445 diagnostics
+ Found 444 diagnostics

CPython (cases_generator) (https://github.com/python/cpython)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 6 diagnostics
+ Found 5 diagnostics

bokeh (https://github.com/bokeh/bokeh)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 878 diagnostics
+ Found 877 diagnostics

CPython (peg_generator) (https://github.com/python/cpython)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 47 diagnostics
+ Found 46 diagnostics

ibis (https://github.com/ibis-project/ibis)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- ibis/examples/__init__.py:122:9: error[unresolved-attribute] Object of type `type` has no attribute `fetch`
- Found 4609 diagnostics
+ Found 4607 diagnostics

hydpy (https://github.com/hydpy-dev/hydpy)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
+ hydpy/core/testtools.py:1376:47: warning[unsupported-dynamic-base] Unsupported class base: Has type `type[T@make_abc_testable]`
+ hydpy/core/testtools.py:1377:49: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- hydpy/core/testtools.py:1378:12: error[invalid-return-type] Return type does not match returned value: expected `type[T@make_abc_testable]`, found `type`
+ hydpy/core/testtools.py:1378:12: error[invalid-return-type] Return type does not match returned value: expected `type[T@make_abc_testable]`, found `<class '<unknown>'>`
- Found 664 diagnostics
+ Found 665 diagnostics

pywin32 (https://github.com/mhammond/pywin32)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 2713 diagnostics
+ Found 2712 diagnostics

pandas (https://github.com/pandas-dev/pandas)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 3795 diagnostics
+ Found 3794 diagnostics

streamlit (https://github.com/streamlit/streamlit)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 104 diagnostics
+ Found 103 diagnostics

jax (https://github.com/google/jax)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 2806 diagnostics
+ Found 2805 diagnostics

materialize (https://github.com/MaterializeInc/materialize)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 515 diagnostics
+ Found 514 diagnostics

static-frame (https://github.com/static-frame/static-frame)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
+ static_frame/core/bus.py:671:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemLocReduces[Bus[Any], object_]`, found `InterGetItemLocReduces[Bus[Any] | Bottom[Series[Any, Any]] | ndarray[Never, Never] | ... omitted 6 union elements, object_]`
- static_frame/core/bus.py:675:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemILocReduces[Bus[Any], object_]`, found `InterGetItemILocReduces[Self@iloc | Bus[Any], object_ | Self@iloc]`
+ static_frame/core/bus.py:675:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemILocReduces[Bus[Any], object_]`, found `InterGetItemILocReduces[Bus[Any] | Bottom[Index[Any]] | TypeBlocks | ... omitted 6 union elements, object_ | Self@iloc]`
+ static_frame/core/series.py:772:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemILocReduces[Series[Any, Any], TVDtype@Series]`, found `InterGetItemILocReduces[Series[Any, Any] | ndarray[Never, Never] | TypeBlocks | ... omitted 6 union elements, TVDtype@Series]`
- static_frame/core/series.py:4072:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemILocReduces[SeriesHE[Any, Any], TVDtype@SeriesHE]`, found `InterGetItemILocReduces[Bottom[Series[Any, Any]] | Bottom[Index[Any]] | TypeBlocks | ... omitted 7 union elements, TVDtype@SeriesHE]`
+ static_frame/core/series.py:4072:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemILocReduces[SeriesHE[Any, Any], TVDtype@SeriesHE]`, found `InterGetItemILocReduces[Bottom[Series[Any, Any]] | ndarray[Never, Never] | TypeBlocks | ... omitted 7 union elements, TVDtype@SeriesHE]`
+ static_frame/core/yarn.py:418:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemILocReduces[Yarn[Any], object_]`, found `InterGetItemILocReduces[Yarn[Any] | ndarray[Never, Never] | TypeBlocks | ... omitted 6 union elements, object_]`
- Found 1825 diagnostics
+ Found 1827 diagnostics

sympy (https://github.com/sympy/sympy)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 15598 diagnostics
+ Found 15597 diagnostics

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 5171 diagnostics
+ Found 5170 diagnostics

rotki (https://github.com/rotki/rotki)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 2104 diagnostics
+ Found 2103 diagnostics

zulip (https://github.com/zulip/zulip)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 3673 diagnostics
+ Found 3672 diagnostics

colour (https://github.com/colour-science/colour)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 417 diagnostics
+ Found 416 diagnostics

core (https://github.com/home-assistant/core)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
+ homeassistant/util/variance.py:47:12: error[invalid-return-type] Return type does not match returned value: expected `(**_P@ignore_variance) -> _R@ignore_variance`, found `_Wrapped[_P@ignore_variance, _R@ignore_variance | int | float | datetime, _P@ignore_variance, _R@ignore_variance | int | float | datetime]`

scipy (https://github.com/scipy/scipy)
- /home/runner/.config/ty/ty.toml:9:1: warning[unknown-rule] Unknown rule `unsupported-dynamic-base`
- Found 8082 diagnostics
+ Found 8081 diagnostics

Memory usage changes were detected when running on open source projects
trio (https://github.com/python-trio/trio)
- TOTAL MEMORY USAGE: ~159MB
+ TOTAL MEMORY USAGE: ~167MB

@charliermarsh
Copy link
Member Author

I think the scrapy, black, and aiohttp-devtools changes are true positives.

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 29, 2025

Merging this PR will not alter performance

✅ 23 untouched benchmarks
⏩ 30 skipped benchmarks1


Comparing charlie/dyn (dd2fbb3) with main (78ef241)

Open in CodSpeed

Footnotes

  1. 30 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@charliermarsh charliermarsh marked this pull request as ready for review December 29, 2025 23:35
@charliermarsh charliermarsh marked this pull request as draft December 29, 2025 23:36
@astral-sh-bot
Copy link

astral-sh-bot bot commented Dec 30, 2025

ecosystem-analyzer results

Lint rule Added Removed Changed
unknown-rule 0 156 0
invalid-return-type 1 1 11
invalid-argument-type 5 3 3
invalid-assignment 0 2 5
unsupported-dynamic-base 7 0 0
unresolved-attribute 1 2 2
possibly-missing-attribute 0 3 1
unused-ignore-comment 3 0 0
invalid-await 0 2 0
type-assertion-failure 2 0 0
Total 19 169 22

Full report with detailed diff (timing results)

@charliermarsh charliermarsh marked this pull request as draft December 30, 2025 16:28
@charliermarsh charliermarsh force-pushed the charlie/dyn branch 2 times, most recently from 6c6a3a5 to b4e2567 Compare December 30, 2025 17:12
@charliermarsh charliermarsh marked this pull request as ready for review December 30, 2025 17:12
@AlexWaygood
Copy link
Member

AlexWaygood commented Dec 30, 2025

I haven't looked too hard at this yet, but is adding a new Type variant definitely the best way of doing this? We've talked in the past about making ClassLiteral (the wrapped data inside the Type::ClassLiteral variant) an enum. In almost all respects, types created using three-argument type() calls should be treated the same way as classes created using class statements (the only difference is that its definition in the AST will be an ExprCall rather than a StmtClassDef), and that design would better reflect that, I think.

We should also try to make our design here extensible for other classes-created-by-function-calls: functional namedtuples, functional typeddicts, and functional enums.

@AlexWaygood
Copy link
Member

For a previous attempt to make ClassLiteral an enum, you can see #19998. We eventually realised that that wasn't the correct way to go to implement NewType, but it still might be for three-argument type(), functional typeddicts, functional namedtuples and functional enums.

@charliermarsh
Copy link
Member Author

I can give that a try. I initially tried to add another variant to ClassType, but there was so much coupling to the class AST node that it ended up not being worth it in my assessment.

@charliermarsh
Copy link
Member Author

(The context around functional namedtuples, functional typeddicts, and functional enums is also very useful, thank you.)

@charliermarsh charliermarsh marked this pull request as draft December 30, 2025 19:12
@charliermarsh charliermarsh force-pushed the charlie/dyn branch 2 times, most recently from 5744687 to 217dafb Compare December 31, 2025 18:01
Copy link
Member

Choose a reason for hiding this comment

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

We should also emit a diagnostic (but don't currently on this branch) if you try to use an @final class as the base class for a dynamic class, e.g.

from typing import final

@final
class Base: ...

type("X", (Base,), {})

This is maybe a counter-argument to https://github.com/astral-sh/ruff/pull/22291/files#r2678657516 -- if we looped through all dynamic class definitions in TypeInferenceBuilder::check_class_definitions as well as all the static class definitions, it might have been harder to forget to implement this check... but I'm guess there's a lot of stuff in that method that currently assumes that we have a StmtClassDef AST node, so it may be that what you have right now is the best design.

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe I did this in #22499. I can revisit the approach in that review (RE whether it's worth using check_class_definitions), if that works?

Copy link
Member

Choose a reason for hiding this comment

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

yeah sure!

@AlexWaygood
Copy link
Member

From my perspective, I think this is basically ready to go now! My remaining concerns are #22291 (comment) (which I'd like @MichaReiser's or @carljm's opinion on) and #22291 (comment).

@charliermarsh charliermarsh force-pushed the charlie/dyn branch 3 times, most recently from dd8e67d to 873595a Compare January 12, 2026 15:15
@charliermarsh charliermarsh force-pushed the charlie/dyn branch 2 times, most recently from 80828b4 to 7403df1 Compare January 12, 2026 15:34
@charliermarsh
Copy link
Member Author

charliermarsh commented Jan 12, 2026

I dropped support for "dangling" type(...) expressions for now. I attempted to retain all existing tests with appropriate TODOs.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

LGTM! (But maybe give @carljm a chance to have another once-over if he wants to, before landing 😄)

@charliermarsh charliermarsh merged commit 4abc5fe into main Jan 12, 2026
49 checks passed
@charliermarsh charliermarsh deleted the charlie/dyn branch January 12, 2026 20:20
charliermarsh added a commit that referenced this pull request Jan 13, 2026
charliermarsh added a commit that referenced this pull request Jan 14, 2026
charliermarsh added a commit that referenced this pull request Jan 14, 2026
## Summary

This PR is intended to demonstrate how the pattern established in
#22291 generalizes to other class
"kinds".

Closes astral-sh/ty#1049.

---------

Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
/// [`unsupported-base`]: https://docs.astral.sh/ty/rules/unsupported-base
pub(crate) static UNSUPPORTED_DYNAMIC_BASE = {
summary: "detects dynamic class bases that are unsupported as ty could not feasibly calculate the class's MRO",
status: LintStatus::preview("1.0.0"),
Copy link
Member

Choose a reason for hiding this comment

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

It looks like claude loves to make this up as preview("1.0.0")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ecosystem-analyzer ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support type()'s functional syntax

5 participants

Comments