Skip to content

Commit 7691bb0

Browse files
committed
Added inferred type annotations
1 parent f760520 commit 7691bb0

16 files changed

+77
-64
lines changed

.pyre_configuration

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"source_directories": [
3+
"."
4+
]
5+
}

leetcode/models/any_of_graphql_question_detail_solution.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
12+
from __future__ import annotations
1213

1314
import pprint
1415
import re # noqa: F401
@@ -33,7 +34,7 @@ class AnyOfGraphqlQuestionDetailSolution(object):
3334

3435
attribute_map = {}
3536

36-
def __init__(self): # noqa: E501
37+
def __init__(self) -> None: # noqa: E501
3738
"""AnyOfGraphqlQuestionDetailSolution - a model defined in Swagger""" # noqa: E501
3839
self.discriminator = None
3940

@@ -66,21 +67,21 @@ def to_dict(self):
6667

6768
return result
6869

69-
def to_str(self):
70+
def to_str(self) -> str:
7071
"""Returns the string representation of the model"""
7172
return pprint.pformat(self.to_dict())
7273

73-
def __repr__(self):
74+
def __repr__(self) -> str:
7475
"""For `print` and `pprint`"""
7576
return self.to_str()
7677

77-
def __eq__(self, other):
78+
def __eq__(self, other: AnyOfGraphqlQuestionDetailSolution) -> bool:
7879
"""Returns true if both objects are equal"""
7980
if not isinstance(other, AnyOfGraphqlQuestionDetailSolution):
8081
return False
8182

8283
return self.__dict__ == other.__dict__
8384

84-
def __ne__(self, other):
85+
def __ne__(self, other) -> bool:
8586
"""Returns true if both objects are not equal"""
8687
return not self == other

leetcode/models/graphql_data.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
12+
from __future__ import annotations
1213

1314
import pprint
1415
import re # noqa: F401
@@ -33,7 +34,7 @@ class GraphqlData(object):
3334

3435
attribute_map = {"question": "question", "user": "user"}
3536

36-
def __init__(self, question=None, user=None): # noqa: E501
37+
def __init__(self, question=None, user=None) -> None: # noqa: E501
3738
"""GraphqlData - a model defined in Swagger""" # noqa: E501
3839
self._question = None
3940
self._user = None
@@ -114,21 +115,21 @@ def to_dict(self):
114115

115116
return result
116117

117-
def to_str(self):
118+
def to_str(self) -> str:
118119
"""Returns the string representation of the model"""
119120
return pprint.pformat(self.to_dict())
120121

121-
def __repr__(self):
122+
def __repr__(self) -> str:
122123
"""For `print` and `pprint`"""
123124
return self.to_str()
124125

125-
def __eq__(self, other):
126+
def __eq__(self, other: GraphqlData) -> bool:
126127
"""Returns true if both objects are equal"""
127128
if not isinstance(other, GraphqlData):
128129
return False
129130

130131
return self.__dict__ == other.__dict__
131132

132-
def __ne__(self, other):
133+
def __ne__(self, other) -> bool:
133134
"""Returns true if both objects are not equal"""
134135
return not self == other

leetcode/models/graphql_question_code_snippet.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
12+
from __future__ import annotations
1213

1314
import pprint
1415
import re # noqa: F401
@@ -45,7 +46,7 @@ class GraphqlQuestionCodeSnippet(object):
4546

4647
def __init__(
4748
self, lang=None, lang_slug=None, code=None, typename=None
48-
): # noqa: E501
49+
) -> None: # noqa: E501
4950
"""GraphqlQuestionCodeSnippet - a model defined in Swagger""" # noqa: E501
5051
self._lang = None
5152
self._lang_slug = None
@@ -183,21 +184,21 @@ def to_dict(self):
183184

184185
return result
185186

186-
def to_str(self):
187+
def to_str(self) -> str:
187188
"""Returns the string representation of the model"""
188189
return pprint.pformat(self.to_dict())
189190

190-
def __repr__(self):
191+
def __repr__(self) -> str:
191192
"""For `print` and `pprint`"""
192193
return self.to_str()
193194

194-
def __eq__(self, other):
195+
def __eq__(self, other: GraphqlQuestionCodeSnippet) -> bool:
195196
"""Returns true if both objects are equal"""
196197
if not isinstance(other, GraphqlQuestionCodeSnippet):
197198
return False
198199

199200
return self.__dict__ == other.__dict__
200201

201-
def __ne__(self, other):
202+
def __ne__(self, other) -> bool:
202203
"""Returns true if both objects are not equal"""
203204
return not self == other

leetcode/models/graphql_question_contributor.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
12+
from __future__ import annotations
1213

1314
import pprint
1415
import re # noqa: F401
@@ -45,7 +46,7 @@ class GraphqlQuestionContributor(object):
4546

4647
def __init__(
4748
self, username=None, profile_url=None, avatar_url=None, typename=None
48-
): # noqa: E501
49+
) -> None: # noqa: E501
4950
"""GraphqlQuestionContributor - a model defined in Swagger""" # noqa: E501
5051
self._username = None
5152
self._profile_url = None
@@ -183,21 +184,21 @@ def to_dict(self):
183184

184185
return result
185186

186-
def to_str(self):
187+
def to_str(self) -> str:
187188
"""Returns the string representation of the model"""
188189
return pprint.pformat(self.to_dict())
189190

190-
def __repr__(self):
191+
def __repr__(self) -> str:
191192
"""For `print` and `pprint`"""
192193
return self.to_str()
193194

194-
def __eq__(self, other):
195+
def __eq__(self, other: GraphqlQuestionContributor) -> bool:
195196
"""Returns true if both objects are equal"""
196197
if not isinstance(other, GraphqlQuestionContributor):
197198
return False
198199

199200
return self.__dict__ == other.__dict__
200201

201-
def __ne__(self, other):
202+
def __ne__(self, other) -> bool:
202203
"""Returns true if both objects are not equal"""
203204
return not self == other

leetcode/models/graphql_question_solution.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
12+
from __future__ import annotations
1213

1314
import pprint
1415
import re # noqa: F401
@@ -37,7 +38,7 @@ class GraphqlQuestionSolution(object):
3738
"typename": "__typename",
3839
}
3940

40-
def __init__(self, id=None, can_see_detail=None, typename=None): # noqa: E501
41+
def __init__(self, id=None, can_see_detail=None, typename=None) -> None: # noqa: E501
4142
"""GraphqlQuestionSolution - a model defined in Swagger""" # noqa: E501
4243
self._id = None
4344
self._can_see_detail = None
@@ -149,21 +150,21 @@ def to_dict(self):
149150

150151
return result
151152

152-
def to_str(self):
153+
def to_str(self) -> str:
153154
"""Returns the string representation of the model"""
154155
return pprint.pformat(self.to_dict())
155156

156-
def __repr__(self):
157+
def __repr__(self) -> str:
157158
"""For `print` and `pprint`"""
158159
return self.to_str()
159160

160-
def __eq__(self, other):
161+
def __eq__(self, other: GraphqlQuestionSolution) -> bool:
161162
"""Returns true if both objects are equal"""
162163
if not isinstance(other, GraphqlQuestionSolution):
163164
return False
164165

165166
return self.__dict__ == other.__dict__
166167

167-
def __ne__(self, other):
168+
def __ne__(self, other) -> bool:
168169
"""Returns true if both objects are not equal"""
169170
return not self == other

leetcode/models/graphql_question_topic_tag.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
12+
from __future__ import annotations
1213

1314
import pprint
1415
import re # noqa: F401
@@ -45,7 +46,7 @@ class GraphqlQuestionTopicTag(object):
4546

4647
def __init__(
4748
self, name=None, slug=None, translated_name=None, typename=None
48-
): # noqa: E501
49+
) -> None: # noqa: E501
4950
"""GraphqlQuestionTopicTag - a model defined in Swagger""" # noqa: E501
5051
self._name = None
5152
self._slug = None
@@ -180,21 +181,21 @@ def to_dict(self):
180181

181182
return result
182183

183-
def to_str(self):
184+
def to_str(self) -> str:
184185
"""Returns the string representation of the model"""
185186
return pprint.pformat(self.to_dict())
186187

187-
def __repr__(self):
188+
def __repr__(self) -> str:
188189
"""For `print` and `pprint`"""
189190
return self.to_str()
190191

191-
def __eq__(self, other):
192+
def __eq__(self, other: GraphqlQuestionTopicTag) -> bool:
192193
"""Returns true if both objects are equal"""
193194
if not isinstance(other, GraphqlQuestionTopicTag):
194195
return False
195196

196197
return self.__dict__ == other.__dict__
197198

198-
def __ne__(self, other):
199+
def __ne__(self, other) -> bool:
199200
"""Returns true if both objects are not equal"""
200201
return not self == other

leetcode/models/graphql_user.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
12+
from __future__ import annotations
1213

1314
import pprint
1415
import re # noqa: F401
@@ -36,7 +37,7 @@ class GraphqlUser(object):
3637
"is_current_user_premium": "isCurrentUserPremium",
3738
}
3839

39-
def __init__(self, username=None, is_current_user_premium=None): # noqa: E501
40+
def __init__(self, username=None, is_current_user_premium=None) -> None: # noqa: E501
4041
"""GraphqlUser - a model defined in Swagger""" # noqa: E501
4142
self._username = None
4243
self._is_current_user_premium = None
@@ -117,21 +118,21 @@ def to_dict(self):
117118

118119
return result
119120

120-
def to_str(self):
121+
def to_str(self) -> str:
121122
"""Returns the string representation of the model"""
122123
return pprint.pformat(self.to_dict())
123124

124-
def __repr__(self):
125+
def __repr__(self) -> str:
125126
"""For `print` and `pprint`"""
126127
return self.to_str()
127128

128-
def __eq__(self, other):
129+
def __eq__(self, other: GraphqlUser) -> bool:
129130
"""Returns true if both objects are equal"""
130131
if not isinstance(other, GraphqlUser):
131132
return False
132133

133134
return self.__dict__ == other.__dict__
134135

135-
def __ne__(self, other):
136+
def __ne__(self, other) -> bool:
136137
"""Returns true if both objects are not equal"""
137138
return not self == other

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
12+
from __future__ import annotations
1213
from setuptools import find_packages, setup # noqa: H301
1314

1415
NAME = "python-leetcode"
1516
VERSION = "1.0.10"
1617

1718
with open("README.md") as readme:
18-
DESCRIPTION = readme.read()
19+
DESCRIPTION: str = readme.read()
1920

2021
# To install the library, run the following
2122
#

test/test_any_of_graphql_question_detail_solution.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
1212

13-
from __future__ import absolute_import
13+
from __future__ import annotations, absolute_import
1414

1515
import unittest
1616

@@ -24,13 +24,13 @@
2424
class TestAnyOfGraphqlQuestionDetailSolution(unittest.TestCase):
2525
"""AnyOfGraphqlQuestionDetailSolution unit test stubs"""
2626

27-
def setUp(self):
27+
def setUp(self) -> None:
2828
pass
2929

30-
def tearDown(self):
30+
def tearDown(self) -> None:
3131
pass
3232

33-
def testAnyOfGraphqlQuestionDetailSolution(self):
33+
def testAnyOfGraphqlQuestionDetailSolution(self) -> None:
3434
"""Test AnyOfGraphqlQuestionDetailSolution"""
3535
# FIXME: construct object with mandatory attributes with example values
3636
# model = leetcode.models.any_of_graphql_question_detail_solution.AnyOfGraphqlQuestionDetailSolution() # noqa: E501

test/test_graphql_data.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
1212

13-
from __future__ import absolute_import
13+
from __future__ import annotations, absolute_import
1414

1515
import unittest
1616

@@ -22,13 +22,13 @@
2222
class TestGraphqlData(unittest.TestCase):
2323
"""GraphqlData unit test stubs"""
2424

25-
def setUp(self):
25+
def setUp(self) -> None:
2626
pass
2727

28-
def tearDown(self):
28+
def tearDown(self) -> None:
2929
pass
3030

31-
def testGraphqlData(self):
31+
def testGraphqlData(self) -> None:
3232
"""Test GraphqlData"""
3333
# FIXME: construct object with mandatory attributes with example values
3434
# model = leetcode.models.graphql_data.GraphqlData() # noqa: E501

0 commit comments

Comments
 (0)