Created
November 10, 2022 12:10
-
-
Save Justaus3r/9e5632c42898bd6dd745c8c00f7d9dd7 to your computer and use it in GitHub Desktop.
waaaa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Licensed under WTF Public License | |
from typing import NoReturn, Union | |
class ZaryabFoundError(Exception): | |
pass | |
class MardanaKamzoriError(Exception): | |
def __init__(self, msg: str, *args, **kwargs) -> None: | |
super().__init__(msg, *args, **kwargs) | |
class PostWatcher: | |
def watcher(self,person: str, mooch: bool, daari: bool) -> Union[None, NoReturn]: | |
if all([mooch, daari]): | |
print("Lanat hue taade te vi") | |
else: | |
raise ZaryabFoundError | |
post = PostWatcher() | |
# will work | |
post.watcher(person="Abdul Moiz, Qazi", daari=True, mooch=True) | |
try: | |
post.watcher(person="Dexent Zaryab", daari=False, mooch=False) | |
except ZaryabFoundError: | |
raise MardanaKamzoriError("Mardana Kamzoori Found!") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment