Change in osmocom-bb[master]: trx_toolkit/data_msg.py: add type hints to static methods

fixeria gerrit-no-reply at lists.osmocom.org
Mon Apr 12 01:30:33 UTC 2021


fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/23676 )

Change subject: trx_toolkit/data_msg.py: add type hints to static methods
......................................................................

trx_toolkit/data_msg.py: add type hints to static methods

Change-Id: I06fd8bc7418700de40467fd63a08da2bc2abcea2
---
M src/target/trx_toolkit/data_msg.py
1 file changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/target/trx_toolkit/data_msg.py b/src/target/trx_toolkit/data_msg.py
index 742dce4..f5d570f 100644
--- a/src/target/trx_toolkit/data_msg.py
+++ b/src/target/trx_toolkit/data_msg.py
@@ -25,6 +25,7 @@
 import struct
 import abc
 
+from typing import List
 from enum import Enum
 from gsm_shared import *
 
@@ -187,22 +188,22 @@
 		return result
 
 	@staticmethod
-	def usbit2sbit(bits):
+	def usbit2sbit(bits: List[int]) -> List[int]:
 		''' Convert unsigned soft-bits {254..0} to soft-bits {-127..127}. '''
 		return [-127 if (b == 0xff) else 127 - b for b in bits]
 
 	@staticmethod
-	def sbit2usbit(bits):
+	def sbit2usbit(bits: List[int]) -> List[int]:
 		''' Convert soft-bits {-127..127} to unsigned soft-bits {254..0}. '''
 		return [127 - b for b in bits]
 
 	@staticmethod
-	def sbit2ubit(bits):
+	def sbit2ubit(bits: List[int]) -> List[int]:
 		''' Convert soft-bits {-127..127} to bits {1..0}. '''
 		return [int(b < 0) for b in bits]
 
 	@staticmethod
-	def ubit2sbit(bits):
+	def ubit2sbit(bits: List[int]) -> List[int]:
 		''' Convert bits {1..0} to soft-bits {-127..127}. '''
 		return [-127 if b else 127 for b in bits]
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/23676
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I06fd8bc7418700de40467fd63a08da2bc2abcea2
Gerrit-Change-Number: 23676
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210412/915ea651/attachment.htm>


More information about the gerrit-log mailing list