-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail gracefully on diverging recursive type aliases #13352
Fail gracefully on diverging recursive type aliases #13352
Conversation
This comment has been minimized.
This comment has been minimized.
1 similar comment
Diff from mypy_primer, showing the effect of this PR on open source code: spark (https://github.com/apache/spark)
- python/pyspark/sql/pandas/map_ops.py:329: error: Name "DataFrameLike" is not defined [name-defined]
- python/pyspark/sql/pandas/group_ops.py:255: error: Name "DataFrameLike" is not defined [name-defined]
- python/pyspark/sql/pandas/group_ops.py:256: error: Name "DataFrameLike" is not defined [name-defined]
- python/pyspark/sql/pandas/group_ops.py:333: error: Name "DataFrameLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:73: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:83: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:94: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:106: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:119: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:133: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:148: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:157: error: Name "DataFrameLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:158: error: Name "DataFrameLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:161: error: Name "DataFrameLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:170: error: Name "DataFrameLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:180: error: Name "DataFrameLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:191: error: Name "DataFrameLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:203: error: Name "DataFrameLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:216: error: Name "DataFrameLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:230: error: Name "DataFrameLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:245: error: Name "DataFrameLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:250: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:251: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:255: error: Name "DataFrameLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:256: error: Name "DataFrameLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:263: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:264: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:265: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:266: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:267: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:269: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:274: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:275: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:276: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:277: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:278: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:279: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:280: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:286: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:287: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:288: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:289: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:290: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:291: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:292: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:293: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:299: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:300: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:301: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:302: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:303: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:304: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:305: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:306: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:307: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:313: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:314: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:315: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:316: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:317: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:318: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:319: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:320: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:321: error: Name "SeriesLike" is not defined [name-defined]
- python/pyspark/sql/pandas/functions.pyi:322: error: Name "SeriesLike" is not defined [name-defined]
|
The old |
Sorry for not waiting for review here, it looks like this will help with another (more important) PR. |
This is another follow up on #13297.
We can't support aliases like
Nested = Union[T, Nested[List[T]]]
(and it looks like no-one can, without hacks like fixed type recursion limit). I would propose to just ban them for now. We can reconsider if people will ask for this.cc @JukkaL