changeset 413:0a6bc66562d3

Use modern syntax for super everywhere
author Amine Sehili <amine.sehili@gmail.com>
date Fri, 21 Jun 2024 20:12:53 +0200
parents 5a6685f1e42d
children 9f83c1ecb03b
files auditok/core.py auditok/exceptions.py auditok/util.py
diffstat 3 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/auditok/core.py	Thu Jun 20 21:51:11 2024 +0200
+++ b/auditok/core.py	Fri Jun 21 20:12:53 2024 +0200
@@ -518,7 +518,7 @@
         start_sec = start_ms / 1000
         stop_sec = None if stop_ms is None else stop_ms / 1000
         index = slice(start_sec, stop_sec)
-        return super(_MillisView, self).__getitem__(index)
+        return super().__getitem__(index)
 
     def __len__(self):
         """
--- a/auditok/exceptions.py	Thu Jun 20 21:51:11 2024 +0200
+++ b/auditok/exceptions.py	Fri Jun 21 20:12:53 2024 +0200
@@ -4,7 +4,7 @@
     def __init__(self, message, block_dur, sampling_rate):
         self.block_dur = block_dur
         self.sampling_rate = sampling_rate
-        super(TooSmallBlockDuration, self).__init__(message)
+        super().__init__(message)
 
 
 class TimeFormatError(Exception):
--- a/auditok/util.py	Thu Jun 20 21:51:11 2024 +0200
+++ b/auditok/util.py	Fri Jun 21 20:12:53 2024 +0200
@@ -394,7 +394,7 @@
     """
 
     def __init__(self, audio_source):
-        super(_Recorder, self).__init__(audio_source)
+        super().__init__(audio_source)
         self._cache = []
         self._read_block = self._read_and_cache
         self._read_from_cache = False
@@ -443,7 +443,7 @@
     """
 
     def __init__(self, audio_source, max_read):
-        super(_Limiter, self).__init__(audio_source)
+        super().__init__(audio_source)
         self._max_read = max_read
         self._max_samples = round(max_read * self.sr)
         self._bytes_per_sample = self.sw * self.ch
@@ -470,7 +470,7 @@
         return block
 
     def rewind(self):
-        super(_Limiter, self).rewind()
+        super().rewind()
         self._read_samples = 0
 
 
@@ -522,7 +522,7 @@
         if hop_dur >= block_dur:
             raise ValueError('"hop_dur" should be <= "block_dur"')
 
-        super(_OverlapAudioReader, self).__init__(audio_source, block_dur)
+        super().__init__(audio_source, block_dur)
 
         self._hop_size = int(hop_dur * self.sr)
         self._blocks = self._iter_blocks_with_overlap()
@@ -559,7 +559,7 @@
             return None
 
     def rewind(self):
-        super(_OverlapAudioReader, self).rewind()
+        super().rewind()
         self._blocks = self._iter_blocks_with_overlap()
 
     @property