]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-110938: More syntax tests for PEP695 funcs and classes (#110986)
authorNikita Sobolev <mail@sobolevn.me>
Wed, 18 Oct 2023 05:00:04 +0000 (08:00 +0300)
committerGitHub <noreply@github.com>
Wed, 18 Oct 2023 05:00:04 +0000 (22:00 -0700)
Lib/test/test_syntax.py

index f5cf9667d564a0d6c738387dead04216d9b375b9..00c5f624ceb3ab6e43aa4f83478e7e037c8002c0 100644 (file)
@@ -1004,11 +1004,26 @@ Missing ':' before suites:
    Traceback (most recent call last):
    SyntaxError: expected ':'
 
+   >>> def f[T]()
+   ...     pass
+   Traceback (most recent call last):
+   SyntaxError: expected ':'
+
    >>> class A
    ...     pass
    Traceback (most recent call last):
    SyntaxError: expected ':'
 
+   >>> class A[T]
+   ...     pass
+   Traceback (most recent call last):
+   SyntaxError: expected ':'
+
+   >>> class A[T]()
+   ...     pass
+   Traceback (most recent call last):
+   SyntaxError: expected ':'
+
    >>> class R&D:
    ...     pass
    Traceback (most recent call last):