File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 4
4
5.2 (unreleased)
5
5
----------------
6
6
7
- - Nothing changed yet .
7
+ - Document that `` __name__ `` is needed to define classes .
8
8
9
9
10
10
5.1 (2020-10-07)
Original file line number Diff line number Diff line change @@ -101,12 +101,15 @@ Necessary setup
101
101
properly.
102
102
103
103
To use classes in Python 3
104
- ``__metaclass__ `` must be set. Set it to ``type `` to use no custom metaclass.
104
+ * ``__metaclass__ `` must be set. Set it to ``type `` to use no custom metaclass.
105
+ * ``__name__ `` must be set. As classes need a namespace to be defined in.
106
+ It is the name of the module the class is defined in. You might set it to
107
+ an arbitrary string.
105
108
106
109
To use ``for `` statements and comprehensions:
107
- * ``_getiter_ `` must point to an ``iter `` implementation. As an unguarded variant you might use
110
+ * ``_getiter_ `` must point to an ``iter `` implementation. As an unguarded variant you might use
108
111
:func: `RestrictedPython.Eval.default_guarded_getiter `.
109
-
112
+
110
113
* ``_iter_unpack_sequence_ `` must point to :func: `RestrictedPython.Guards.guarded_iter_unpack_sequence `.
111
114
112
115
To use ``getattr ``
You can’t perform that action at this time.
0 commit comments