File tree Expand file tree Collapse file tree
doc/data/messages/c/cyclic-import Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ def count_to_one ():
2+ return 1
3+
4+
5+ def count_to_three ():
6+ from .bad2 import count_to_two # [cyclic-import]
7+
8+ return count_to_two () + 1
Original file line number Diff line number Diff line change 1+ from .bad import count_to_one
2+
3+
4+ def count_to_two ():
5+ return count_to_one () + 1
Original file line number Diff line number Diff line change 1- You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953 >`_ !
1+ The good code is just an example. There are various strategies to resolving
2+ cyclic imports and the best choice relies heavily on the context of the code
3+ and the affected modules.
Original file line number Diff line number Diff line change 1- # This is a placeholder for correct code for this message.
1+ def count_to_one ():
2+ return 1
3+
4+
5+ def count_to_two ():
6+ return count_to_one () + 1
7+
8+
9+ def count_to_three ():
10+ return count_to_two () + 1
You can’t perform that action at this time.
0 commit comments