Repository navigation
fix new rule - ban dynamic types #3765 - #3869
Closed
asukaminato0721 wants to merge 3 commits into
Closed
asukaminato0721 wants to merge 3 commits into
asukaminato0721 wants to merge 3 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
asukaminato0721
marked this pull request as draft
June 18, 2026 15:46
This comment has been minimized.
This comment has been minimized.
connernilsen
approved these changes
Jul 23, 2026
connernilsen
left a comment
Contributor
There was a problem hiding this comment.
Looks good, thanks for working on this!
Contributor
|
@connernilsen has imported this pull request. If you are a Meta employee, you can view this in D113475815. |
|
Diff from mypy_primer, showing the effect of this PR on open source code: mkdocs (https://github.com/mkdocs/mkdocs)
+ ERROR mkdocs/config/config_options.py:101:28-31: Base class `type[Self@SubConfig]` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR mkdocs/plugins.py:75:28-31: Base class `type[Self@BasePlugin]` in `type()` call is not a statically known class [unsupported-dynamic-base]
steam.py (https://github.com/Gobot1234/steam.py)
+ ERROR steam/_gc/client.py:74:32-46: Base classes in `type()` calls must be a tuple literal of statically known classes [unsupported-dynamic-base]
+ ERROR steam/enums.py:120:13-122:14: Base classes in `type()` calls must be a tuple literal of statically known classes [unsupported-dynamic-base]
spark (https://github.com/apache/spark)
+ ERROR python/pyspark/pandas/typedef/typehints.py:891:43-55: Base class `type[IndexNameTypeHolder | NameTypeHolder]` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR python/pyspark/pandas/typedef/typehints.py:911:43-55: Base class `type[IndexNameTypeHolder | NameTypeHolder]` in `type()` call is not a statically known class [unsupported-dynamic-base]
prefect (https://github.com/PrefectHQ/prefect)
- ERROR src/prefect/input/run_input.py:419:1-2: Unused `# type: ignore` comment [unused-type-ignore]
scikit-build-core (https://github.com/scikit-build/scikit-build-core)
+ ERROR src/scikit_build_core/setuptools/wrapper.py:74:14-23: Base class `type[_DistributionT]` in `type()` call is not a statically known class [unsupported-dynamic-base]
bidict (https://github.com/jab/bidict)
+ ERROR bidict/_base.py:152:47-50: Base class `type[Self@BidictBase]` in `type()` call is not a statically known class [unsupported-dynamic-base]
psycopg (https://github.com/psycopg/psycopg)
+ ERROR psycopg/psycopg/types/array.py:337:52-56: Base class `type[ArrayLoader] | Any` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR psycopg/psycopg/types/json.py:120:26-30: Base class `type[Dumper]` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR psycopg/psycopg/types/json.py:140:26-30: Base class `type[Loader]` in `type()` call is not a statically known class [unsupported-dynamic-base]
schemathesis (https://github.com/schemathesis/schemathesis)
+ ERROR src/schemathesis/core/deserialization.py:137:54-64: Base class `type[CSafeLoader] | type[SafeLoader]` in `type()` call is not a statically known class [unsupported-dynamic-base]
beartype (https://github.com/beartype/beartype)
+ ERROR beartype/_util/cls/utilclsmake.py:104:27-37: Base classes in `type()` calls must be a tuple literal of statically known classes [unsupported-dynamic-base]
pandera (https://github.com/pandera-dev/pandera)
+ ERROR pandera/api/dataframe/model.py:288:42-52: Base class `type[BaseConfig]` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR pandera/api/dataframe/model.py:340:55-58: Base class `type[Self@DataFrameModel]` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR pandera/api/dataframe/model.py:507:32-42: Base class `type[BaseConfig]` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR pandera/api/pyspark/model.py:214:55-58: Base class `type[Self@DataFrameModel]` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR pandera/api/xarray/model.py:263:32-42: Base class `type[DataArrayConfig | DataTreeConfig | DatasetConfig]` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR pandera/api/xarray/model.py:469:42-52: Base class `type[DataArrayConfig]` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR pandera/api/xarray/model.py:571:42-52: Base class `type[DatasetConfig]` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR pandera/api/xarray/model.py:684:42-52: Base class `type[DataTreeConfig]` in `type()` call is not a statically known class [unsupported-dynamic-base]
pytest-autoprofile (https://gitlab.com/TTsangSC/pytest-autoprofile)
+ ERROR src/pytest_autoprofile/_doctest.py:361:38-48: Base class `type[DocTestRunner]` in `type()` call is not a statically known class [unsupported-dynamic-base]
ibis (https://github.com/ibis-project/ibis)
+ ERROR ibis/expr/operations/udf.py:155:51-60: Base class `[B: Value[Unknown]](self: Self@_UDF) -> type[B]` in `type()` call is not a statically known class [unsupported-dynamic-base]
strawberry (https://github.com/strawberry-graphql/strawberry)
+ ERROR strawberry/tools/merge_types.py:35:39-44: Base classes in `type()` calls must be a tuple literal of statically known classes [unsupported-dynamic-base]
+ ERROR strawberry/types/base.py:341:14-25: Base class `type[Any]` in `type()` call is not a statically known class [unsupported-dynamic-base]
hydpy (https://github.com/hydpy-dev/hydpy)
+ ERROR hydpy/core/modeltools.py:3251:61-74: Base class `type[Any]` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR hydpy/core/testtools.py:1401:47-55: Base class `type[T_inv]` in `type()` call is not a statically known class [unsupported-dynamic-base]
dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ERROR ddtrace/vendor/debtcollector/moves.py:192:39-48: Base class `type[object]` in `type()` call is not a statically known class [unsupported-dynamic-base]
pandas (https://github.com/pandas-dev/pandas)
+ ERROR pandas/tseries/holiday.py:819:34-44: Base class `type[AbstractHolidayCalendar] | Unknown` in `type()` call is not a statically known class [unsupported-dynamic-base]
werkzeug (https://github.com/pallets/werkzeug)
+ ERROR src/werkzeug/test.py:819:32-48: Base class `type[Response]` in `type()` call is not a statically known class [unsupported-dynamic-base]
core (https://github.com/home-assistant/core)
+ ERROR homeassistant/helpers/deprecation.py:110:14-23: Base class `type` in `type()` call is not a statically known class [unsupported-dynamic-base]
spack (https://github.com/spack/spack)
+ ERROR lib/spack/spack/builder.py:137:17-22: Base classes in `type()` calls must be a tuple literal of statically known classes [unsupported-dynamic-base]
+ ERROR lib/spack/spack/util/lang.py:706:50-60: Base class `type[Self@ObjectWrapper]` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR lib/spack/spack/util/lang.py:706:62-73: Base class `type[Any]` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR lib/spack/spack/util/lang.py:708:50-61: Base class `type[Any]` in `type()` call is not a statically known class [unsupported-dynamic-base]
pydantic (https://github.com/pydantic/pydantic)
+ ERROR pydantic/v1/config.py:183:27-39: Base classes in `type()` calls must be a tuple literal of statically known classes [unsupported-dynamic-base]
+ ERROR pydantic/v1/schema.py:1094:50-55: Base class `type[SecretBytes | SecretStr]` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR pydantic/v1/schema.py:1101:54-59: Base class `type[str]` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR pydantic/v1/schema.py:1110:54-59: Base class `type[bytes]` in `type()` call is not a statically known class [unsupported-dynamic-base]
artigraph (https://github.com/artigraph/artigraph)
+ ERROR src/arti/internal/mappings.py:111:49-52: Base class `type[Self@TypedBox]` in `type()` call is not a statically known class [unsupported-dynamic-base]
+ ERROR src/arti/types/__init__.py:341:18-21: Base class `type[Self@_ScalarClassTypeAdapter]` in `type()` call is not a statically known class [unsupported-dynamic-base]
|
grievejia
approved these changes
Jul 29, 2026
grievejia
left a comment
Contributor
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Contributor
|
@connernilsen merged this pull request in 5385bcc. |
avokin2
pushed a commit
to avokin2/pyrefly
that referenced
this pull request
Aug 12, 2026
Summary: Fixes pyrefly-org#3765 Added unsupported-dynamic-base error kind, added builtin type(name, bases, dict) checking, and documented the new error kind. Pull Request resolved: pyrefly-org#3869 Test Plan: add test Reviewed By: grievejia Differential Revision: D113475815 Pulled By: connernilsen fbshipit-source-id: e8f15cc94f39cd740be0df2b05406d869986cc8e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3765
Added unsupported-dynamic-base error kind, added builtin type(name, bases, dict) checking, and documented the new error kind.
Test Plan
add test