3 ms·
>- shading works around these constraints by renaming.... one SDK's use of that library (package) to a new, unambiguous name. The key point is both the conflict
by zahlman 2y ago
>- shading works around these constraints by renaming.... one SDK's use of that library (package) to a new, unambiguous name. The key point is both the conflicted library C and the SDK that uses it B get rewritten. Note, this would break at runtime if...
> similarly in python, if in your project you use two libraries which each separately use e.g. pydantic at 1.x and 2.x, and your own code isolates these from each other (i.e. classes from B don't get passed through methods in A, etc), then you could pretty safely rename one version (e.g. `pydantic` 1.x in library gets renamed as `pydanticlegacy`) -- but the common tooling doesn't generally support this.
The thing is that Python offers way more opportunity to do weird things that would break this at runtime, while not providing the tools to enforce that kind of isolation at compile time (I don't know if type checkers would be powerful enough for complex cases there, because I don't use them; but the language implementation is free to ignore any complaints from a type checker anyway).