| 56 | |
| 57 | ==== Inner classes |
| 58 | Inner classes (classes inside classes) are **not supported**. You can not import, call or use inner classes. Inner classes can not be translated. This is for many reasons but the brief summary: |
| 59 | * The useful variant of inner class is the non-static inner class. This class can access fields in the enclosing class. |
| 60 | * Python does not support accessing fields of the enclosing class unless some tricks are applied. But these tricks would break uniformity of constructors. |
| 61 | * Many deep technical reasons that largely complicate dealing with these. |
| 62 | |
| 63 | We recommend now: |
| 64 | * manually override translation when you really need to call an inner class |
| 65 | * use package-private classes to replace your own inner classes. |
| 66 | * For the non-static inner class: pass the enclosing class as argument to the child class constructor. You may have to use more tricks to get around cyclic dependencies. |