FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Remove Python 3.7 branches by srittau · Pull Request #11238 · python/typeshed · GitHub

Repository navigation

Remove Python 3.7 branches - #11238

Merged
srittau merged 11 commits into
python:mainfrom
srittau:rm-3.7-branches
Jan 5, 2024
Merged

srittau merged 11 commits into
python:mainfrom
srittau:rm-3.7-branches

Conversation

srittau commented Jan 4, 2024

Copy link
Copy Markdown
Collaborator

Part of #10113

This comment has been minimized.

JelleZijlstra 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I only got up to D, but this looks generally good.

Comment thread stdlib/_socket.pyi

def close(__fd: _FD) -> None: ...
def dup(__fd: _FD) -> int: ...
def close(__fd: SupportsIndex) -> None: ...

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We also have a _typeshed.FileDescriptor alias but it's just int. No change needed in this PR, but might be worth looking into whether we can make that alias usable here.

Comment thread stdlib/csv.pyi Outdated

srittau commented Jan 4, 2024

Copy link
Copy Markdown
Collaborator Author

So, this crashes mypy:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "mypy/semanal.py", line 6539, in accept
  File "mypy/nodes.py", line 1310, in accept
  File "mypy/semanal.py", line 2889, in visit_assignment_stmt
  File "mypy/semanal.py", line 3393, in process_type_annotation
  File "mypy/semanal.py", line 6690, in anal_type
  File "mypy/types.py", line 955, in accept
  File "mypy/typeanal.py", line 259, in visit_unbound_type
  File "mypy/typeanal.py", line 399, in visit_unbound_type_nonoptional
  File "mypy/typeanal.py", line 6[24](https://github.com/python/typeshed/actions/runs/7411345628/job/20165674610?pr=11238#step:5:25), in try_analyze_special_unbound_type
  File "mypy/typeanal.py", line 1470, in analyze_literal_type
  File "mypy/typeanal.py", line 1484, in analyze_literal_param
  File "mypy/typeanal.py", line 1738, in named_type
  File "mypy/typeanal.py", line [25](https://github.com/python/typeshed/actions/runs/7411345628/job/20165674610?pr=11238#step:5:26)6, in lookup_fully_qualified
  File "mypy/semanal.py", line 5852, in lookup_fully_qualified
AssertionError: builtins.str

mypy fails to find builtins.str which seems weird. I reverted stdlib/builtins.pyi, but that had no effect.

Copy link
Copy Markdown
Member

mypy fails to find builtins.str which seems weird. I reverted stdlib/builtins.pyi, but that had no effect.

I'm guessing there is some disturbance in the builtin import cycle. Possibly because the collections import was removed from typing.pyi.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

srittau commented Jan 4, 2024

Copy link
Copy Markdown
Collaborator Author

The jinja2 warning is in a Python 3.7 code branch.

srittau marked this pull request as ready for review January 4, 2024 16:00

This comment has been minimized.

Copy link
Copy Markdown
Collaborator

Thanks for working on this! One request, can we merge #11219 first?

hauntsaninja left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

E-M looked good, and I have faith in you and our tests for the rest

github-actions Bot commented Jan 5, 2024

Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

spack (https://github.com/spack/spack)
+ lib/spack/spack/install_test.py:520: error: Unused "type: ignore" comment  [unused-ignore]
+ lib/spack/spack/install_test.py:522: error: Unused "type: ignore" comment  [unused-ignore]

jinja (https://github.com/pallets/jinja)
+ src/jinja2/debug.py:130: error: Argument 6 to "CodeType" has incompatible type "bytes"; expected "int"  [arg-type]
+ src/jinja2/debug.py:131: error: Argument 7 to "CodeType" has incompatible type "Tuple[Any, ...]"; expected "bytes"  [arg-type]
+ src/jinja2/debug.py:134: error: Argument 10 to "CodeType" has incompatible type "str"; expected "Tuple[str, ...]"  [arg-type]
+ src/jinja2/debug.py:136: error: Argument 12 to "CodeType" has incompatible type "int"; expected "str"  [arg-type]
+ src/jinja2/debug.py:137: error: Argument 13 to "CodeType" has incompatible type "bytes"; expected "int"  [arg-type]
+ src/jinja2/debug.py:138: error: Argument 14 to "CodeType" has incompatible type "Tuple[str, ...]"; expected "bytes"  [arg-type]
+ src/jinja2/ext.py:297: error: Incompatible redefinition (redefinition with type "Callable[[Arg(str, 'c'), Arg(str, 's')], str]", original type "Callable[[Arg(str, 'context'), Arg(str, 'message')], str]")  [misc]
+ src/jinja2/ext.py:304: error: Incompatible redefinition (redefinition with type "Callable[[Arg(str, 'c'), Arg(str, 's'), Arg(str, 'p'), Arg(int, 'n')], str]", original type "Callable[[Arg(str, 'context'), Arg(str, 'msgid1'), Arg(str, 'msgid2'), Arg(int, 'n')], str]")  [misc]

srittau merged commit 2360485 into python:main Jan 5, 2024
srittau deleted the rm-3.7-branches branch January 5, 2024 10:39
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL