Attention is currently required from: dexter, laforge.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/35440?usp=email )
Change subject: Fix enumeration of GlobbalPlatformISDR during card_init() ......................................................................
Patch Set 1:
(1 comment)
File pySim/global_platform.py:
https://gerrit.osmocom.org/c/pysim/+/35440/comment/98c6e6a5_f0f8d0c1 PS1, Line 262: intermediate = False
Something that only exists in CardApplicationSD but not any derived classes.
This can be done by making `intermediate` private by renaming it to `__intermediate`. This prefix makes fields and methods somewhat special:
``` class Parent: # this field can be accessed as self.__intermediate by methods of this class, # but not by methods of child classes and not from the outside __intermediate = True
class Child(Parent): pass
Parent.__intermediate # yields AttributeError Child.__intermediate # yields AttributeError
Parent._Parent__intermediate # True Child._Parent__intermediate # True Child._Child__intermediate # yields AttributeError
```
As can be seen, `Child` class still does inherit field `__intermediate`, but Python prepends the parent class name to it. So you can use this when iterating over the sub-classes of `CardApplication`:
``` if hasattr(app_cls, '_' + app_cls.__name__ + '__intermediate'): continue # skip intermediate classes ```
See also: https://stackoverflow.com/questions/20261517/inheritance-of-private-and-prot....