Changes between Version 33 and Version 34 of j2p


Ignore:
Timestamp:
06/22/23 11:13:41 (17 months ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • j2p

    v33 v34  
    5454
    5555If function calls in python deliver a wrong object (not matching the above mapping), the translator has to inject additional code to convert it to the proper object. For example, {{{Map.getKeys()}}} in python would be {{{set(map.keys())}}} where the extra {{{set}}} converts the dict_keys into a proper set.
     56
     57==== Inner classes
     58Inner 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
     63We 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.
    5667
    5768==== More notes: