Attention is currently required from: dexter, fixeria, neels.
Patch set 14:-Code-Review
1 comment:
File pySim/esim/saip/personalization.py:
Patch Set #13, Line 50: r"""Base class representing a part of the eSIM profile that is configurable during the
abc has no purpose and it doesn't work.
My gist was that it doesn't solve exactly the problem you are trying to solve, but that doesn't mean it has no porpose and doesn't work.
> The first time this comment came up, I tried to use abc to determine which ConfigurableParameter classes are abstract. This did not work at all.
Sadly code review (particularly dragging on over the better part of a year so everyone forgets about what exactly was discussed before) is not a method of how you could demonstrate what exactly was not working in which way exactly. In such instances I would appreciate a "this is the branch containing what I tried, and it does not do XYZ while I'm trying to achieve ABC".
> Adding empty cruft to code is not what I do.
You sound like adding type annotations is also empty cruft?
If a class is not supposed to be used directly, but only inherited by other classes (one of which finally being none-abstract), it's an abstract base class. Adding the annotation by inheriting from abc.ABC shows that at the very least to whoever is reading the code, and ideally also allows the python runtime to raise meaningful exceptions if someone ever should try to instantiate the ABC directly. If you don't do that, people could just instantiate your class.
> the logical reason to change the patch is simply not present. I would love to accept your point, but explain to me why exactly you want to see abc in there.
The logical point is simply: there is a python standard library method of declaring "this class is abstract and shall not be instantiated directly". If your class falls into that category, it should be declared that way.
Furthermore, the code contains abc.abstractmethod decorator on a class that is not an ABC. According to the documentation this violates the abc module requirements:
```
A decorator indicating abstract methods. Using this decorator requires that the class’s metaclass is ABCMeta or is derived from it.
See https://docs.python.org/3/library/abc.html#abc.abstractmethod
```
> If the reason is cosmetic, then let me know.
I will disagree and i will still have to use a simple boolean flag to make it work as it should,
You may need to do that, to solve your specific problem (different from what abc may solve). But to this point, after lots of code review I still don't fully understand the full picture, especially as I have no example/branch of "what doesn't work". I'm not trying to undestand everything in the review of this specific patch, but I'm merely saying
I'm not saying the above is solving all of your problems in the way you are trying to solve them.
To view, visit change 39742. To unsubscribe, or for help writing mail filters, visit settings.