79537015

Date: 2025-03-26 18:55:51
Score: 0.5
Natty:
Report link

In addition to InSync's solution, you can also do this:

from typing import Self

class A:
    B: 'A'
    
A.B = A()

This is an example of a forward reference, and mypy handles those by putting the type name in quotes.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Brendan Mitchell