microsoft / yardl

Tooling for streaming instrument data
https://microsoft.github.io/yardl/
MIT License
29 stars 5 forks source link

Python union classes generated with duplicate type parameters #111

Closed naegelejd closed 7 months ago

naegelejd commented 7 months ago

Using the following model:

GenericUnion<T>: !union
  t: T
  tv: T*
  tvf: T[]

yardl v0.4.0 generates invalid Python:

class GenericUnion(typing.Generic[T, T_NP, T, T_NP, T, T_NP]):

Error message on import:

TypeError: Parameters to Generic[...] must all be unique