zlacker

[parent] [thread] 2 comments
1. heaven+(OP)[view] [source] 2022-09-06 12:23:55
It happens very frequently if you are not very good at separating your data model from logic.
replies(1): >>welder+S6
2. welder+S6[view] [source] 2022-09-06 13:07:18
>>heaven+(OP)
Why would there exist a way in Python to conditionally import types, for the purpose of preventing cyclic imports, if cyclic imports weren't a problem?

Your comment makes it seem like you haven't experienced Python types enough, or you wouldn't think it was so easy.

replies(1): >>heaven+r0j
◧◩
3. heaven+r0j[view] [source] [discussion] 2022-09-12 12:37:01
>>welder+S6
> Your comment makes it seem like you haven't experienced Python types enough, or you wouldn't think it was so easy.

Oh trust me I did and I constantly slap on the wrists juniors who over-complicate their solutions to the problem :)

> Why would there exist a way in Python to conditionally import types, for the purpose of preventing cyclic imports, if cyclic imports weren't a problem?

Because it's easier to understand than the solution to cyclic imports without conditional imports.

[go to top]