@@ -245,7 +245,7 @@ def edited(self) -> datetime.datetime:
245
245
"""Datetime of last edit of the comment."""
246
246
return self ._edited
247
247
248
- def get_reactions (self ) -> list [Reaction ]:
248
+ def get_reactions (self ) -> Union [ list [Reaction ], Iterable [ Reaction ] ]:
249
249
"""Returns list of reactions."""
250
250
raise NotImplementedError ()
251
251
@@ -343,7 +343,7 @@ def created(self) -> datetime.datetime:
343
343
raise NotImplementedError ()
344
344
345
345
@property
346
- def labels (self ) -> list ["IssueLabel" ]:
346
+ def labels (self ) -> Union [ list ["IssueLabel" ], Iterable [ "IssueLabel" ] ]:
347
347
"""Labels of the issue."""
348
348
raise NotImplementedError ()
349
349
@@ -417,7 +417,7 @@ def get_list(
417
417
author : Optional [str ] = None ,
418
418
assignee : Optional [str ] = None ,
419
419
labels : Optional [list [str ]] = None ,
420
- ) -> list ["Issue" ]:
420
+ ) -> Union [ list ["Issue" ], Iterable [ "Issue" ] ]:
421
421
"""
422
422
List of issues.
423
423
@@ -644,7 +644,7 @@ def created(self) -> datetime.datetime:
644
644
raise NotImplementedError ()
645
645
646
646
@property
647
- def labels (self ) -> list ["PRLabel" ]:
647
+ def labels (self ) -> Union [ list ["PRLabel" ], Iterable [ "PRLabel" ] ]:
648
648
"""Labels of the pull request."""
649
649
raise NotImplementedError ()
650
650
@@ -761,7 +761,10 @@ def get(project: Any, id: int) -> "PullRequest":
761
761
raise NotImplementedError ()
762
762
763
763
@staticmethod
764
- def get_list (project : Any , status : PRStatus = PRStatus .open ) -> list ["PullRequest" ]:
764
+ def get_list (
765
+ project : Any ,
766
+ status : PRStatus = PRStatus .open ,
767
+ ) -> Union [list ["PullRequest" ], Iterable ["PullRequest" ]]:
765
768
"""
766
769
List of pull requests.
767
770
@@ -841,7 +844,7 @@ def get_comments(
841
844
"""
842
845
raise NotImplementedError ()
843
846
844
- def get_all_commits (self ) -> list [str ]:
847
+ def get_all_commits (self ) -> Union [ list [str ], Iterable [ str ] ]:
845
848
"""
846
849
Returns:
847
850
List of commit hashes of commits in pull request.
@@ -925,7 +928,7 @@ def add_label(self, *labels: str) -> None:
925
928
"""
926
929
raise NotImplementedError ()
927
930
928
- def get_statuses (self ) -> list ["CommitFlag" ]:
931
+ def get_statuses (self ) -> Union [ list ["CommitFlag" ], Iterable [ "CommitFlag" ] ]:
929
932
"""
930
933
Returns statuses for latest commit on pull request.
931
934
@@ -1014,7 +1017,10 @@ def _from_raw_commit_flag(self) -> None:
1014
1017
raise NotImplementedError ()
1015
1018
1016
1019
@staticmethod
1017
- def get (project : Any , commit : str ) -> list ["CommitFlag" ]:
1020
+ def get (
1021
+ project : Any ,
1022
+ commit : str ,
1023
+ ) -> Union [list ["CommitFlag" ], Iterable ["CommitFlag" ]]:
1018
1024
"""
1019
1025
Acquire commit statuses for given commit in the project.
1020
1026
@@ -1226,7 +1232,7 @@ def get_latest(project: Any) -> Optional["Release"]:
1226
1232
raise NotImplementedError ()
1227
1233
1228
1234
@staticmethod
1229
- def get_list (project : Any ) -> list ["Release" ]:
1235
+ def get_list (project : Any ) -> Union [ list ["Release" ], Iterable [ "Release" ] ]:
1230
1236
"""
1231
1237
Returns:
1232
1238
List of the objects that represent releases.
@@ -1388,7 +1394,7 @@ def list_projects(
1388
1394
user : Optional [str ] = None ,
1389
1395
search_pattern : Optional [str ] = None ,
1390
1396
language : Optional [str ] = None ,
1391
- ) -> list ["GitProject" ]:
1397
+ ) -> Union [ list ["GitProject" ], Iterable [ "GitProject" ] ]:
1392
1398
"""
1393
1399
List projects for given criteria.
1394
1400
@@ -1496,7 +1502,7 @@ def has_issues(self) -> bool:
1496
1502
"""`True` if issues are enabled on the project."""
1497
1503
raise NotImplementedError ()
1498
1504
1499
- def get_branches (self ) -> list [str ]:
1505
+ def get_branches (self ) -> Union [ list [str ], Iterable [ str ] ]:
1500
1506
"""
1501
1507
Returns:
1502
1508
List with names of branches in the project.
@@ -1508,7 +1514,7 @@ def default_branch(self) -> str:
1508
1514
"""Default branch (usually `main`, `master` or `trunk`)."""
1509
1515
raise NotImplementedError ()
1510
1516
1511
- def get_commits (self , ref : Optional [str ] = None ) -> list [str ]:
1517
+ def get_commits (self , ref : Optional [str ] = None ) -> Union [ list [str ], Iterable [ str ] ]:
1512
1518
"""
1513
1519
Get list of commits for the project.
1514
1520
@@ -1540,7 +1546,7 @@ def get_fork(self, create: bool = True) -> Optional["GitProject"]:
1540
1546
"""
1541
1547
raise NotImplementedError ()
1542
1548
1543
- def get_owners (self ) -> list [str ]:
1549
+ def get_owners (self ) -> Union [ list [str ], Iterable [ str ] ]:
1544
1550
"""
1545
1551
Returns:
1546
1552
List of usernames of project owners.
@@ -1639,7 +1645,7 @@ def get_issue_list(
1639
1645
author : Optional [str ] = None ,
1640
1646
assignee : Optional [str ] = None ,
1641
1647
labels : Optional [list [str ]] = None ,
1642
- ) -> list ["Issue" ]:
1648
+ ) -> Union [ list ["Issue" ], Iterable [ "Issue" ] ]:
1643
1649
"""
1644
1650
List of issues.
1645
1651
@@ -1722,7 +1728,10 @@ def create_issue(
1722
1728
"""
1723
1729
raise NotImplementedError ()
1724
1730
1725
- def get_pr_list (self , status : PRStatus = PRStatus .open ) -> list ["PullRequest" ]:
1731
+ def get_pr_list (
1732
+ self ,
1733
+ status : PRStatus = PRStatus .open ,
1734
+ ) -> Union [list ["PullRequest" ], Iterable ["PullRequest" ]]:
1726
1735
"""
1727
1736
List of pull requests.
1728
1737
@@ -1765,7 +1774,7 @@ def get_pr_files_diff(
1765
1774
"""
1766
1775
raise NotImplementedError ()
1767
1776
1768
- def get_tags (self ) -> list ["GitTag" ]:
1777
+ def get_tags (self ) -> Union [ list ["GitTag" ], Iterable [ "GitTag" ] ]:
1769
1778
"""
1770
1779
Returns:
1771
1780
List of objects that represent tags.
@@ -1814,7 +1823,7 @@ def get_latest_release(self) -> Optional[Release]:
1814
1823
"""
1815
1824
raise NotImplementedError ()
1816
1825
1817
- def get_releases (self ) -> list [Release ]:
1826
+ def get_releases (self ) -> Union [ list [Release ], Iterable [ Release ] ]:
1818
1827
"""
1819
1828
Returns:
1820
1829
List of the objects that represent releases.
@@ -1895,7 +1904,10 @@ def commit_comment(
1895
1904
"""
1896
1905
raise NotImplementedError ()
1897
1906
1898
- def get_commit_comments (self , commit : str ) -> list [CommitComment ]:
1907
+ def get_commit_comments (
1908
+ self ,
1909
+ commit : str ,
1910
+ ) -> Union [list [CommitComment ], Iterable [CommitComment ]]:
1899
1911
"""
1900
1912
Get comments for a commit.
1901
1913
@@ -1947,7 +1959,10 @@ def set_commit_status(
1947
1959
"""
1948
1960
raise NotImplementedError ()
1949
1961
1950
- def get_commit_statuses (self , commit : str ) -> list [CommitFlag ]:
1962
+ def get_commit_statuses (
1963
+ self ,
1964
+ commit : str ,
1965
+ ) -> Union [list [CommitFlag ], Iterable [CommitFlag ]]:
1951
1966
"""
1952
1967
Get statuses of the commit.
1953
1968
@@ -2018,7 +2033,7 @@ def get_files(
2018
2033
ref : Optional [str ] = None ,
2019
2034
filter_regex : Optional [str ] = None ,
2020
2035
recursive : bool = False ,
2021
- ) -> list [str ]:
2036
+ ) -> Union [ list [str ], Iterable [ str ] ]:
2022
2037
"""
2023
2038
Get a list of file paths of the repo.
2024
2039
@@ -2039,7 +2054,7 @@ def get_files(
2039
2054
"""
2040
2055
raise NotImplementedError
2041
2056
2042
- def get_forks (self ) -> Sequence ["GitProject" ]:
2057
+ def get_forks (self ) -> Union [ Sequence ["GitProject" ], Iterable [ "GitProject" ] ]:
2043
2058
"""
2044
2059
Returns:
2045
2060
All forks of the project.
@@ -2106,14 +2121,14 @@ def get_email(self) -> str:
2106
2121
"""
2107
2122
raise NotImplementedError ()
2108
2123
2109
- def get_projects (self ) -> Sequence ["GitProject" ]:
2124
+ def get_projects (self ) -> Union [ Sequence ["GitProject" ], Iterable [ "GitProject" ] ]:
2110
2125
"""
2111
2126
Returns:
2112
2127
Sequence of projects in user's namespace.
2113
2128
"""
2114
2129
raise NotImplementedError ()
2115
2130
2116
- def get_forks (self ) -> Sequence ["GitProject" ]:
2131
+ def get_forks (self ) -> Union [ Sequence ["GitProject" ], Iterable [ "GitProject" ] ]:
2117
2132
"""
2118
2133
Returns:
2119
2134
Sequence of forks in user's namespace.
0 commit comments