99from praw .models .reddit .more import MoreComments
1010
1111if TYPE_CHECKING :
12- import praw . models
12+ from praw import models
1313
1414
1515class CommentForest :
@@ -19,7 +19,7 @@ class CommentForest:
1919
2020 """
2121
22- def __getitem__ (self , index : int ) -> praw . models .Comment :
22+ def __getitem__ (self , index : int ) -> models .Comment :
2323 """Return the comment at position ``index`` in the list.
2424
2525 This method is to be used like an array access, such as:
@@ -43,7 +43,7 @@ def __len__(self) -> int:
4343 """Return the number of top-level comments in the forest."""
4444 return len (self ._comments )
4545
46- def _insert_comment (self , comment : praw . models .Comment ) -> None :
46+ def _insert_comment (self , comment : models .Comment ) -> None :
4747 if comment .name in self ._submission ._comments_by_id :
4848 raise DuplicateReplaceException
4949 comment .submission = self ._submission
@@ -58,7 +58,7 @@ def _insert_comment(self, comment: praw.models.Comment) -> None:
5858
5959 def list (
6060 self ,
61- ) -> list [praw . models .Comment | praw . models .MoreComments ]:
61+ ) -> list [models .Comment | models .MoreComments ]:
6262 """Return a flattened list of all comments.
6363
6464 This list may contain :class:`.MoreComments` instances if :meth:`.replace_more`
@@ -76,9 +76,9 @@ def list(
7676
7777 @staticmethod
7878 def _gather_more_comments (
79- tree : list [praw . models .MoreComments ],
79+ tree : list [models .MoreComments ],
8080 * ,
81- parent_tree : list [praw . models .MoreComments ] | None = None ,
81+ parent_tree : list [models .MoreComments ] | None = None ,
8282 ) -> list [MoreComments ]:
8383 """Return a list of :class:`.MoreComments` objects obtained from tree."""
8484 more_comments = []
@@ -98,8 +98,8 @@ def _gather_more_comments(
9898
9999 def __init__ (
100100 self ,
101- submission : praw . models .Submission ,
102- comments : list [praw . models .Comment ] | None = None ,
101+ submission : models .Submission ,
102+ comments : list [models .Comment ] | None = None ,
103103 ) -> None :
104104 """Initialize a :class:`.CommentForest` instance.
105105
@@ -112,12 +112,12 @@ def __init__(
112112 self ._comments = comments
113113 self ._submission = submission
114114
115- def _update (self , comments : list [praw . models .Comment ]) -> None :
115+ def _update (self , comments : list [models .Comment ]) -> None :
116116 self ._comments = comments
117117 for comment in comments :
118118 comment .submission = self ._submission
119119
120- def replace_more (self , * , limit : int | None = 32 , threshold : int = 0 ) -> list [praw . models .MoreComments ]:
120+ def replace_more (self , * , limit : int | None = 32 , threshold : int = 0 ) -> list [models .MoreComments ]:
121121 """Update the comment forest by resolving instances of :class:`.MoreComments`.
122122
123123 :param limit: The maximum number of :class:`.MoreComments` instances to replace.
0 commit comments