3 ms·
> Unless anyone knows of magical tools to help solve import issues? Topological sorting? Always wondered why programming languages can't do what package manage
by matheusmoreira 5y ago
> Unless anyone knows of magical tools to help solve import issues?
Topological sorting? Always wondered why programming languages can't do what package managers do.
- sltkr 5y agoThe breakage described can only occur if there are dependency cycles, so topological sorting can't fix it. If there are no cycles, then the order of imports doesn't matter. edit: Actually I'm not even sure what kind of error we're talking about here. If two modules import each other and they both need access to the other's contents upon initialization, there is no ordering that will work. And if at most one needs access to the other, it will always work, no matter in which order they are imported. So I don't really know what the OP was talking about.