Open hotay opened 7 years ago
I agree that this should be considered much later since it's not that huge need. Despite PyCharm, I believe the code completion engine like Vim's YouCompleteMe could cope with this.
@tklarryonline No, actually, if we still use magic in robber.py, YCM could not understand it too (we are using it so we can make sure :D). Anyway, I'm agree that it should be considered later.
Oh really 😐. I thought YCM uses word-matching to suggest us the next possible use case...
I can say that it's more intelligent than what pyCharm can do :P.
Last update:
jedi
repo: https://github.com/davidhalter/jedi/issues/825. We can set jedi.settings.auto_import_modules
. And if it's possible for jedi
then YCM should work since YCM is actually backed by jedi
.So, let's do a quick summary for this issue:
jedi
and write documentation for anacoda and jedi.I cannot get Pycharm, Atom with Jedi, Sublime with Anacoda and Jedi to autocomplete robber.py
. So I come up with an easier solution: we create a class named ExpectTemplate
, then we inherit expect
from it. The code will look like this:
class ExpectTemplate:
@staticmethod
def eq(expected):
"""
:param expected:
:return:
"""
pass
class expect(ExpectTemplate):
...
This is what I get in Pycharm
The benefit of this method is that we can freely show the args/kwargs that the user need to provide. @hieueastagile What do you think?
It seems hacky/workaround, huh?
Not really, it's like we predefine a class with an outline, then override it later.
@catriuspham Honestly, I don't like it :D. ExpectTemplate might not be synced with what we register to expect
, so it's considered a code smell.
@hieueastagile I gonna research more, though :stuck_out_tongue:
wait to see your good news @catriuspham
@catriuspham After a year, I found a way to do that :))): https://amir.rachum.com/blog/2016/10/05/python-dynamic-attributes/
💯
Why we didn't think of __dir__
in the first place :))))
Is this the real life? Is this just fantasy?
:)))). Don't you mind to implement it @tklarryonline @catriuspham :))?
Issue
It's just a thing to consider but since we are using magic for robber.py, there's no code completion engine could understand this. So, we might need to consider this, if we can, this is a strong plus point to robber.py. Anyway, it would be a hard one, then, just consider.