Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOC: add faq and fix a typo in Operator
- Loading branch information
Showing
3 changed files
with
39 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
########################### | ||
Answers to common questions | ||
########################### | ||
|
||
Abbreviations: **Q** uestion -- **P** roblem -- **S** olution | ||
|
||
Errors related to Python 2/3 | ||
---------------------------- | ||
|
||
#. **Q:** I follow your recommendation to call ``super().__init__(dom, ran)`` | ||
in the ``__init__()`` method of my ``MyOperator``, but I get the following | ||
error:: | ||
File <...>, line ..., in __init__ | ||
super().__init__(dom, ran) | ||
|
||
TypeError: super() takes at least 1 argument (0 given) | ||
|
||
**P:** The ``super()`` function `in Python 2 | ||
<https://docs.python.org/2/library/functions.html#super>`_ has to | ||
be called with a type as first argument, whereas | ||
`in Python 3 | ||
<https://docs.python.org/3/library/functions.html#super>`_, the | ||
type argument is optional and usually not needed. | ||
|
||
**S:** We recommend to include ``from builtins import super`` in your | ||
module to backport the new Py3 ``super()`` function. This way, your code | ||
will run in both Python 2 and 3. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters