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

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Thu Apr 8 01:22:25 UTC 2021


fixeria has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/76/23676/1

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-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210408/69f67437/attachment.htm>


More information about the gerrit-log mailing list