Skip to content

Commit

Permalink
Added statement to prevent getiter error (#164)
Browse files Browse the repository at this point in the history
When using for loops, we faced the error `_getiter_` not defined. This is the workaround for resolving it.
  • Loading branch information
riteshm93 authored and Michael Howitz committed Jun 21, 2019
1 parent f5aacdc commit 34b670e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/usage/basic_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ To use classes in Python 3
``__metaclass__`` must be set. Set it to ``type`` to use no custom metaclass.

To use ``for`` statements and comprehensions
``_getiter_`` must point to :func:`RestrictedPython.Eval.default_guarded_getiter` and
``_iter_unpack_sequence_`` must point to :func:`RestrictedPython.Guards.guarded_iter_unpack_sequence`.

To use ``getattr``
Expand Down

0 comments on commit 34b670e

Please sign in to comment.