ahrefs / atd

Static types for JSON APIs
Other
316 stars 52 forks source link

Allow recursive references in atdpy #315

Closed zyannes closed 2 years ago

zyannes commented 2 years ago

Use Python's future annotations to support forward declarations so that atdpy can generate classes with recursive references.

PR checklist

mjambon commented 2 years ago

Neat. Can you please add a test? For that, you would normally edit https://github.com/ahrefs/atd/blob/master/atdpy/test/atd-input/everything.atd and https://github.com/ahrefs/atd/blob/master/atdpy/test/python-tests/test_atdpy.py

A comment explaining why we need from __future__ import annotations would be great too.