@@ -2686,6 +2686,57 @@ def f(x: *b)
26862686 >>> f(x = 5, *:)
26872687 Traceback (most recent call last):
26882688 SyntaxError: Invalid star expression
2689+
2690+ Asserts:
2691+
2692+ >>> assert 1 = 2
2693+ Traceback (most recent call last):
2694+ SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='?
2695+
2696+ >>> assert (1 = 2)
2697+ Traceback (most recent call last):
2698+ SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='?
2699+
2700+ >>> assert 'a' = a
2701+ Traceback (most recent call last):
2702+ SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='?
2703+
2704+ >>> assert x[0] = 1
2705+ Traceback (most recent call last):
2706+ SyntaxError: cannot assign to subscript here. Maybe you meant '==' instead of '='?
2707+
2708+ >>> assert (yield a) = 2
2709+ Traceback (most recent call last):
2710+ SyntaxError: cannot assign to yield expression here. Maybe you meant '==' instead of '='?
2711+
2712+ >>> assert a = 2
2713+ Traceback (most recent call last):
2714+ SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
2715+
2716+ >>> assert (a = 2)
2717+ Traceback (most recent call last):
2718+ SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
2719+
2720+ >>> assert a = b
2721+ Traceback (most recent call last):
2722+ SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
2723+
2724+ >>> assert 1, 1 = b
2725+ Traceback (most recent call last):
2726+ SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='?
2727+
2728+ >>> assert 1, (1 = b)
2729+ Traceback (most recent call last):
2730+ SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='?
2731+
2732+ >>> assert 1, a = 1
2733+ Traceback (most recent call last):
2734+ SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
2735+
2736+ >>> assert 1, (a = 1)
2737+ Traceback (most recent call last):
2738+ SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
2739+
26892740"""
26902741
26912742import re
0 commit comments