-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: python return annotations #51
Comments
Related: #41 (comment) |
I think I just added support for type hints, and fixed the bug at the same time |
Thanks a lot @danymat! def __str__(self) -> str:
"""
Parameters
----------
self:
Returns
-------
str
"""
config_str = ""
for row in self.tile:
row_str = "".join(row)
config_str += row_str + "\n"
return config_str.strip() |
I think the point about @classmethod
def test(cls) -> None:
"""
Parameters
----------
cls:
Returns
-------
None
"""
pass I expect that cls should not be a parameter. |
Also I think def test(a: int) -> None:
"""
Parameters
----------
a: int
Returns
-------
int
None
"""
pass I don't expect it to generate a doc for None returns. def test(a: int) -> None:
"""
Parameters
----------
a: int
"""
pass |
|
This seems to be a little bit difficult to do, I don't think I will do it tonight |
Hello, I think that commit d46c438 did provide a very great handling of such |
class Test:
@staticmethod
def test2(a: int, b: str):
"""
Parameters
----------
a: int
b: str
Returns
-------
int
str
"""
pass
@classmethod
def test(cls, a: int, b: str):
"""
Parameters
----------
a: int
b: str
Returns
-------
int
str
"""
pass
def test1(self, a: int, b: str):
"""
Parameters
----------
a: int
b: str
Returns
-------
int
str
"""
pass
Thanks @danymat I think that did fix the self and cls cases. |
Last commit should fix it, a single line that did this lol. Is everything ok ? |
nice xD good work! |
return config_str.strip()
should be anonymous, and the self should not be a parameter, as it is a method.This is what I expect:
The text was updated successfully, but these errors were encountered: