<p><a href="https://gerrit.osmocom.org/c/pysim/+/24035">View Change</a></p><p>10 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/pysim/+/24035/2/pySim/utils.py">File pySim/utils.py:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/pysim/+/24035/2/pySim/utils.py@869">Patch Set #2, Line 869:</a> <code style="font-family:monospace,monospace">DataObject</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Is this an abstract class?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/pysim/+/24035/2/pySim/utils.py@873">Patch Set #2, Line 873:</a> <code style="font-family:monospace,monospace">this</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">cosmetic: missing dot</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/pysim/+/24035/2/pySim/utils.py@884">Patch Set #2, Line 884:</a> <code style="font-family:monospace,monospace"> self.encoded = None</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">One of these should be 'decoded' I guess, and this is why pylint complains.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/pysim/+/24035/2/pySim/utils.py@917">Patch Set #2, Line 917:</a> <code style="font-family:monospace,monospace"> raise TypeError("The derived classes must defined a from_value() method")</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Let's please use @abc.abstractmethod for that.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/pysim/+/24035/2/pySim/utils.py@921">Patch Set #2, Line 921:</a> <code style="font-family:monospace,monospace"> raise TypeError("The derived classes must defined a to_value() method")</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Let's please use @abc.abstractmethod for that.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/pysim/+/24035/2/pySim/utils.py@972">Patch Set #2, Line 972:</a> <code style="font-family:monospace,monospace">from_value</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Sounds more like from_bytes() given that it accepts 'bytes'?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/pysim/+/24035/2/pySim/utils.py@985">Patch Set #2, Line 985:</a> <code style="font-family:monospace,monospace">members=[]</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Using objects, lists, and tuples as a default argument value is dangerous because all instances of this class will basically share the same object/list/tuple. This causes weird bugs sometimes, so I would definitely avoid it.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/pysim/+/24035/2/pySim/utils.py@991">Patch Set #2, Line 991:</a> <code style="font-family:monospace,monospace"> for m in self.members:</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">This could be done using the comprehension:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> self.members_by_tag = { m for m in members }<br> self.members_by_name = { m for m in members }</pre></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/pysim/+/24035/2/pySim/utils.py@1097">Patch Set #2, Line 1097:</a> <code style="font-family:monospace,monospace">desc</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Unused?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/pysim/+/24035/2/pySim/utils.py@1097">Patch Set #2, Line 1097:</a> <code style="font-family:monospace,monospace">sequence=[])</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Same here.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/pysim/+/24035">change 24035</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/pysim/+/24035"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: pysim </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Iac18e7665481c9323cc7d22a3cd93e3da7869deb </div>
<div style="display:none"> Gerrit-Change-Number: 24035 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Sun, 02 May 2021 20:53:34 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>