Update pyright version

This commit is contained in:
Josh
2024-02-21 05:36:02 +11:00
committed by GitHub
parent 76666fbcf4
commit 4e03b170ef
17 changed files with 39 additions and 35 deletions

View File

@ -429,7 +429,7 @@ class Asset(AssetMixin):
url = url.with_query(url.raw_query_string)
url = str(url)
return Asset(state=self._state, url=url, key=self._key, animated=self._animated)
return self.__class__(state=self._state, url=url, key=self._key, animated=self._animated)
def with_size(self, size: int, /) -> Self:
"""Returns a new asset with the specified size.
@ -457,7 +457,7 @@ class Asset(AssetMixin):
raise ValueError('size must be a power of 2 between 16 and 4096')
url = str(yarl.URL(self._url).with_query(size=size))
return Asset(state=self._state, url=url, key=self._key, animated=self._animated)
return self.__class__(state=self._state, url=url, key=self._key, animated=self._animated)
def with_format(self, format: ValidAssetFormatTypes, /) -> Self:
"""Returns a new asset with the specified format.
@ -492,7 +492,7 @@ class Asset(AssetMixin):
url = yarl.URL(self._url)
path, _ = os.path.splitext(url.path)
url = str(url.with_path(f'{path}.{format}').with_query(url.raw_query_string))
return Asset(state=self._state, url=url, key=self._key, animated=self._animated)
return self.__class__(state=self._state, url=url, key=self._key, animated=self._animated)
def with_static_format(self, format: ValidStaticFormatTypes, /) -> Self:
"""Returns a new asset with the specified static format.