Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typings for DataUrl #3968

Merged
merged 1 commit into from
Nov 23, 2023
Merged

Add typings for DataUrl #3968

merged 1 commit into from
Nov 23, 2023

Conversation

loichuder
Copy link
Member

No description provided.

assert(file_path is None)
assert(data_path is None)
assert(data_slice is None)
assert(scheme is None)
Copy link
Member Author

@loichuder loichuder Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some changes are due to auto-formatting by black. Sorry !

EDIT: I guess it is fine in the end: #3819

"""
self.__path = path
# only replace if ? not here already. Otherwise can mess sith
# data_slice if == ::2 for example
if '?' not in path:
if "?" not in path:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black black black


:rtype: str
"""
def data_path(self) -> str | None:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data_path can be None if path is used to construct the DataUrl.

@loichuder loichuder force-pushed the data-url-typings branch 2 times, most recently from a0c2677 to 8e48652 Compare November 22, 2023 13:03
return self.__data_path

def data_slice(self):
def data_slice(self) -> tuple[SliceLike, ...] | None:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data_slice can also be None if no slice is specified.

@loichuder loichuder force-pushed the data-url-typings branch 2 times, most recently from 120f133 to df0d1e0 Compare November 22, 2023 15:31
@loichuder loichuder requested a review from t20100 November 22, 2023 15:59
Copy link
Member

@t20100 t20100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@loichuder loichuder merged commit 08f9862 into main Nov 23, 2023
@loichuder loichuder deleted the data-url-typings branch November 23, 2023 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants