1

Consider the following dataclass with Python:

from dataclasses import dataclass

@dataclass()
class Foo: 
    some_id: int
    name: str
    child: Foo  # <-- failure here

What's the proper syntax for this recursive definition?

tripleee
  • 175,061
  • 34
  • 275
  • 318
Anemoia
  • 7,928
  • 7
  • 46
  • 71

0 Answers0