Skip to content

Instantly share code, notes, and snippets.

@Justaus3r
Created November 10, 2022 12:10
Show Gist options
  • Save Justaus3r/9e5632c42898bd6dd745c8c00f7d9dd7 to your computer and use it in GitHub Desktop.
Save Justaus3r/9e5632c42898bd6dd745c8c00f7d9dd7 to your computer and use it in GitHub Desktop.
waaaa
#!/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