(root)/
Python-3.11.7/
Lib/
test/
typinganndata/
ann_module3.py
       1  """
       2  Correct syntax for variable annotation that should fail at runtime
       3  in a certain manner. More examples are in test_grammar and test_parser.
       4  """
       5  
       6  def f_bad_ann():
       7      __annotations__[1] = 2
       8  
       9  class ESC[4;38;5;81mC_OK:
      10      def __init__(self, x: int) -> None:
      11          self.x: no_such_name = x  # This one is OK as proposed by Guido
      12  
      13  class ESC[4;38;5;81mD_bad_ann:
      14      def __init__(self, x: int) -> None:
      15          sfel.y: int = 0
      16  
      17  def g_bad_ann():
      18      no_such_name.attr: int = 0