kokarare1212 / librespot-python

Consider decorating method with @staticmethod PYL-R0201
Performance
Major
2 years ago3 years old
Method doesn't use the class instance and could be converted into a static method
 60    def available(self):
 61        return self.size() - self.__pos
 62
 63    def mark_supported(self) -> bool: 64        return True
 65
 66    def mark(self, read_ahead_limit: int) -> None:
Method doesn't use the class instance and could be converted into a static method
776            raise FeederException()
777        return self.load_stream(file, track, None, preload, halt_listener)
778
779    def pick_alternative_if_necessary(780            self, track: Metadata.Track) -> typing.Union[Metadata.Track, None]:
781        if len(track.file) > 0:
782            return track
Method doesn't use the class instance and could be converted into a static method
 41        self.__session.dealer().remove_request_listener(self)
 42        self.__put_state_worker.shutdown()
 43
 44    def initialize_device_info(self, session: Session, 45                               conf: PlayerConfiguration) -> Connect.Device:
 46        return Connect.DeviceInfo(
 47            can_play=True,
Method doesn't use the class instance and could be converted into a static method
1149                username=username,
1150            )
1151
1152        def read_blob_int(self, buffer: io.BytesIO) -> int:1153            lo = buffer.read(1)
1154            if (int(lo[0]) & 0x80) == 0:
1155                return int(lo[0])
Method doesn't use the class instance and could be converted into a static method
 491            raise TypeError()
 492        self.__worker.submit(lambda: self.__worker_callback(builder))
 493
 494    def language(self, lang: str): 495        event = EventService.EventBuilder(EventService.Type.LANGUAGE)
 496        event.append(s=lang)
 497