Trimatix / Carica

Python module that populates variables from TOML config documents, and generates config documents from python variables.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

choose 'best' Union candidate instead of 'first'

Trimatix opened this issue · comments

in order to overcome limiting dataclass field hints to a primative Unions, all types in the union are recursed over and the first successful deserialize is accepted.

Instead, all types in the union should be attempted, and the 'best match' selected. This could be quite slow, so perhaps parameterize this in carica configuration?