Skip to content
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

Fix comment typehints for methods/classmethods #300

Merged
merged 8 commits into from
Jul 25, 2022
Merged

Fix comment typehints for methods/classmethods #300

merged 8 commits into from
Jul 25, 2022

Conversation

mathbou
Copy link
Contributor

@mathbou mathbou commented Aug 5, 2021

When using comment type hints, self and cls parameter appears in method parameters and types do not match anymore.

Using the following code, here is the results:

class Truc(object):
    def foo(self, arg1, arg2):
        # type: (str, int) -> None
        print(arg1, arg2)

With sphinx-autoapi 1.8.3:

With the fix:

@fmigneault
Copy link

@AWhetter
Is it possible to have feedback on this PR as potential fix for #318?
Thanks

@AWhetter
Copy link
Collaborator

AWhetter commented Feb 9, 2022

Hey @mathbou. Sorry it's taken me so long to look at this. The change looks pretty good to me, however there are some failing tests. Please could you fix those, and also rebase on top of master as there were some formatting changes made to conform to the new version of black being used.

@mathbou
Copy link
Contributor Author

mathbou commented Mar 14, 2022

@AWhetter Changes done, is it good for you ?

@AWhetter AWhetter merged commit fc6b8ae into readthedocs:master Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants