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
list comprehension expression raises "TypeError: 'NoneType' object is not subscriptable" #95
Comments
Do you think it is a bug or list comprehensions are not allowed? Is there any workaround? |
Hi @davidemoro I am not sure what you try to archive. please follow the documentation at http://restrictedpython.readthedocs.io/en/latest/ I guess what you try to get is:
that should work |
Hi @loechel, thanks. I think there are some issues with python3.6 as you can see:
so it seems that using both methods list comprehensions doesn't work with Python3.6. Also reading the documentation I see that with |
@davidemoro I added a fix for RestrictionCapableEval in #97. PS.: This is not a new issue in RestrictedPython 4. In 3.6 I got the same exception. |
thanks :) Just a curiosity (sorry, I don't know the technological details of RestrictedPython): I still don't understand why As a RestrictedPython user perspective the RestrictionCapableEval API seems more clean (2 neat lines instead of 4 lines importing a ``safe_builtins I think that Anyway thanks for your tips: if you are so kind to confirm that the Thanks :) PS: the play-python package I've linked int this ticket is deprecated now because its features were included in https://github.com/tierratelematics/pytest-play |
@davidemoro RestrictedPython prevents access using some basic rules (like access to attributes those name starts with underscore is prevented) but there might be some other application specific rules which have to be implemented in functions used for |
Ok, thanks a lot! |
Tested with Python 3.6.1 with RestrictedPython 4.0b2:
where context is:
Any suggestion?
Thanks in advance
The text was updated successfully, but these errors were encountered: