You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def pig_latin(text):
translated_words = [translate(word) for word in words]
Running s.get_names(all_scopes=True, references=True) on it shows the variables within the list comprehension with full names such as __main__.translate and __main__.word rather than the expected __main__.pig_latin.translate
This causes these variable to be in effect be hidden from the function scope, which breaks functionality of static analysis tools. Is the current behavior intended? If so, then would love some signal that the functions and variables belongs to the pig_latin function. If not, would love a fix to the names of the list comprehension variables.
The text was updated successfully, but these errors were encountered:
translated_words seems to have the right name of full_name='__main__.pig_latin.translated_words'
List comprehension variable translate and word still have the wrong names though.
I'm a bit unsure what to do here. The correct name for translate would probably be something else entirely and the correct name for word would probably be __main__.pig_latin.<comprehension>.word. So if you fix that I'm happy to merge a PR, but I'm still a bit unhappy with how translate is handled.
@davidhalter Even though I am passionate about jedi, I am currently busy with some other projects so won't be able to contribute here.
In any case would love it if you or some one else could implement the __main__.pig_latin.<comprehension_1>.word solution. This will prevent Jedi from being broken for list comprehensions, which is a key use-case.
For the script below
Running
s.get_names(all_scopes=True, references=True)
on it shows the variables within the list comprehension with full names such as__main__.translate
and__main__.word
rather than the expected__main__.pig_latin.translate
This causes these variable to be in effect be hidden from the function scope, which breaks functionality of static analysis tools. Is the current behavior intended? If so, then would love some signal that the functions and variables belongs to the
pig_latin
function. If not, would love a fix to the names of the list comprehension variables.The text was updated successfully, but these errors were encountered: