ok, so I thought it didn't really matter how much clutter there is in the script since the only problem is with the comprehension lists. Sorry about that. Here, this is a non working minimal snippet that I have, this is the only thing in `python.snippets`:
snippet test "Test comprehension"
`!p [re.search('a', i) for i in ['kdgj']]`
endsnippet
and it throws me the error "NameError: global name 're' is not defined" when I do 'test<tab>'.
If I use:
snippet test "Test comprehension"
`!p re.search('a', 'skljg')`
endsnippet
then all is well, I don't get any error at all. I mentioned at the beginning that I use Python 3. Might this be causing the problem? Sorry again for not following your adivce but if you can't reproduce this then I don't know.
ok, so I thought it didn't really matter how much clutter there is in the script since the only problem is with the comprehension lists. Sorry about that. Here, this is a non working minimal snippet that I have, this is the only thing in `python.snippets`:
snippet test "Test comprehension"
`!p [re.search('a', i) for i in ['kdgj']]`
endsnippet
and it throws me the error "NameError: global name 're' is not defined" when I do 'test<tab>'.
If I use:
snippet test "Test comprehension"
`!p re.search('a', 'skljg')`
endsnippet
then all is well, I don't get any error at all. I mentioned at the beginning that I use Python 3. Might this be causing the problem? Sorry again for not following your adivce but if you can't reproduce this then I don't know.