Skip to content

Conversation

@Gallaecio
Copy link
Member

e.g.

request_or_response_url: Reuse[ResponseUrl] | RequestUrl

Should use RequestUrl unless ResponseUrl is also requested separately.

@Gallaecio
Copy link
Member Author

Gallaecio commented Dec 27, 2023

I run into a fundamental issue that I was not expecting:

>>> from andi.andi import Reuse
>>> class A:
...   pass
... 
>>> class B:
...  pass
... 
>>> Reuse[A] | B == B | Reuse[A]
True

From the docs:

When comparing unions, the order is ignored

Should I try to find a work around that? Maybe a different syntax? (e.g. Reuse[A, B], or Reuse[A, 0] | Reuse[B, 1] | C)
Should we only support 1 reuse per dependency (i.e. no support for Reuse[A] | Reuse[B] | C), and assume that even in A | Reuse[B] we should prioritize B if it can be reused, even if A comes first?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant