Attention is currently required from: fixeria.
neels has posted comments on this change by neels. (
https://gerrit.osmocom.org/c/pysim/+/39741?usp=email )
Change subject: [1/7] personalization: refactor: drop ClassVarMeta use
......................................................................
Patch Set 4:
(2 comments)
File pySim/esim/saip/personalization.py:
https://gerrit.osmocom.org/c/pysim/+/39741/comment/98345a6c_03268920?usp=em… :
PS4, Line 61: @abc.abstractmethod
Why are you removing this? The COMMIT_MSG says
you're dropping `ClassVarMeta`, but you're also remov […]
i commented on
this on the subsequent commit, TL;DR: no noticeable difference and no need to have it.
If you insist i can put back the @abc.abstractmethod decorator.
Can you explain why is @abstractmethod not a python built-in!?
(The ClassVarMeta is not something I am willing to bring back, see below.)
https://gerrit.osmocom.org/c/pysim/+/39741/comment/9830d14d_d5d00c50?usp=em… :
PS4, Line 147: class SdKeyScp80_01(SdKey, kvn=0x01, key_type=0x88,
permitted_len=[16,24,32]): # AES key type
IMO, the old approach is much more compact and thus
more readable.
IMHO absolutely not.
All members in one line?
With future extensions in upcoming patches, it will look like this
class SdKeyScp81_01Psk(SdKeyScp81_01, is_abstract = False, name =
'SCP81.01-PSK',
key_id = 0x01, key_type = KeyType.tls_psk # 0x85, key_usage_qual = 0x3C):
pass
you cannot seriously prefer that.
So let's make it more readable
class SdKeyScp81_01Psk(SdKeyScp81_01,
is_abstract = False,
name = 'SCP81.01-PSK',
key_id = 0x01,
key_type = KeyType.tls_psk, # 0x85
key_usage_qual = 0x3C):
pass
Congratulations, that is almost standard python, but messed up. I prefer a million times:
class SdKeyScp81_01Psk(SdKeyScp81_01):
is_abstract = False
name = 'SCP81.01-PSK'
key_id = 0x01
key_type = KeyType.tls_psk # 0x85
key_usage_qual = 0x3C
It's standard, shorter, doesn't need messing with the builtin __new__() method.
Complete no-brainer to me.
--
To view, visit
https://gerrit.osmocom.org/c/pysim/+/39741?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I60ea8fd11fb438ec90ddb08b17b658cbb789c051
Gerrit-Change-Number: 39741
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 10 Mar 2025 12:21:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>