-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for
cyclic-import
(#8322)
Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
- Loading branch information
1 parent
81917bc
commit 5bb1fd1
Showing
5 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
def count_to_one(): | ||
return 1 | ||
|
||
|
||
def count_to_three(): | ||
from .bad2 import count_to_two | ||
|
||
return count_to_two() + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .bad import count_to_one # [cyclic-import] | ||
|
||
|
||
def count_to_two(): | ||
return count_to_one() + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
You can help us make the doc better `by contributing <https://github.com/pylint-dev/pylint/issues/5953>`_ ! | ||
The good code is just an example. There are various strategies to resolving | ||
cyclic imports and the best choice relies heavily on the context of the code | ||
and the affected modules. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
# This is a placeholder for correct code for this message. | ||
def count_to_one(): | ||
return 1 | ||
|
||
|
||
def count_to_two(): | ||
return count_to_one() + 1 | ||
|
||
|
||
def count_to_three(): | ||
return count_to_two() + 1 |