Skip to content

Conversation

@sharkdp
Copy link
Contributor

@sharkdp sharkdp commented Oct 8, 2025

The use of named expressions and await expressions results in syntax errors on Python 3.14 (see below). This PR therefore suggests to remove two tests from conformance/tests/qualifiers_annotated.py that were making use of this now-invalid syntax.

▶ uvx [email protected]               
Python 3.14.0 (main, Oct  7 2025, 15:35:21) [Clang 20.1.4 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from typing import Annotated, Literal


>>> Good9: Annotated[Literal[3, 4, 5, None], x := 3]
  File "<python-input-1>", line 1
    Good9: Annotated[Literal[3, 4, 5, None], x := 3]
                                             ^^^^^^
SyntaxError: named expression cannot be used within an annotation



>>> async def func3() -> None:
...     Good10: Annotated[str, await func3()]
...     
  File "<python-input-2>", line 2
    Good10: Annotated[str, await func3()]
                           ^^^^^^^^^^^^^
SyntaxError: await expression cannot be used within an annotation

def run_tests(self, test_files: Sequence[str]) -> dict[str, str]:
proc = run(
["pyrefly", "check", "--output-format", "min-text", "--no-summary"],
["pyrefly", "check", "--output-format", "min-text", "--summary=none"],
Copy link
Contributor Author

@sharkdp sharkdp Oct 8, 2025

Choose a reason for hiding this comment

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

This is a drive-by fix. The latest version of pyrefly does not seem to support --no-summary anymore. Let me know if this should be removed or pulled out into a second PR.

@srittau srittau added the topic: conformance tests Issues with the conformance test suite label Oct 8, 2025
Copy link
Member

@carljm carljm left a comment

Choose a reason for hiding this comment

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

This looks good to me.

@hauntsaninja hauntsaninja merged commit e7ad24c into python:main Oct 8, 2025
4 checks passed
@sharkdp sharkdp deleted the remove-invalid-syntax-tests branch October 9, 2025 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: conformance tests Issues with the conformance test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants