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

Some rope_patch improvements #1288

Closed
spyder-bot opened this issue Feb 17, 2015 · 5 comments
Closed

Some rope_patch improvements #1288

spyder-bot opened this issue Feb 17, 2015 · 5 comments

Comments

@spyder-bot
Copy link
Collaborator

From sergey.s...@gmail.com on 2013-02-27T15:17:03Z

Colleagues,
I have a few suggestions about rope_patch.py code.

  1. The code in lines 195-200 looks a bit suspicious:
    def _get_single_function_docstring(self, pyfunction):
    signature = self._get_function_signature(pyfunction)
    docs = pyfunction.get_doc()
    docs = self._trim_docstring(pyfunction.get_doc(), indents=0)
    return docs
    return signature + ':\n\n' + docs

Obviously a piece of it is unreachable and pyfunction.get_doc() is called twice. What return statement is the correct one?

  1. get_calltip(...) has inconsistent return statements:
    In most of the cases the function returns something or None, except of this case (lines 176-177):

if ignore_unknown and not isinstance(pyobject, pyobjects.PyFunction):
return

Should it read as "return None" to be consistent with all the other cases?

Thanks,
Sergey

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1288

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-03-05T10:02:33Z

Thanks a lot for your sugestions. I'll look more carefully at them when I have some time and try to add them before 2.2 is definitely released.

Labels: MS-v2.2 Cat-Editor

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-03-25T09:23:21Z

Sergey:

  1. You are right about it. I'm gonna fix it.
  2. I checked against rope and the inconsistent return is there too, so I prefer to leave it.

Thanks for your time and suggestions.

Summary: Some rope_patch improvements (was: rope_patch.py suggestions)

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-03-25T09:26:10Z

This issue was updated by revision b0c1a000af2a .

  • Thanks to Sergey Satskiy for noticing it.

Status: Fixed

@spyder-bot
Copy link
Collaborator Author

From sergey.s...@gmail.com on 2013-03-25T09:29:06Z

Thanks for the fix!

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-03-25T09:37:16Z

You're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant