Skip to content

Commit

Permalink
Preserve the order of candidates for pg.typing.Union.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 620082515
  • Loading branch information
daiyip authored and pyglove authors committed Mar 28, 2024
1 parent e15b9a2 commit 1fbcb8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyglove/core/typing/annotation_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _value_spec_from_type_annotation(
if len(args) == 1:
spec = _value_spec_from_annotation(args[0], True)
else:
spec = vs.Union([_value_spec_from_annotation(x, True) for x in set(args)])
spec = vs.Union([_value_spec_from_annotation(x, True) for x in args])
if optional:
spec = spec.noneable()
return spec
Expand Down

0 comments on commit 1fbcb8a

Please sign in to comment.