diff --git a/README.md b/README.md index 783800f..f08f9f7 100755 --- a/README.md +++ b/README.md @@ -74,6 +74,19 @@ except Exception: The context manager form of fuckit can't allow the code to continue past an error like the decorator and import forms can. If you want the code to continue after an exception, wrap the code block in a function and use the decorator instead. +### As a type +Use Fuckit for any type checking you don't want to deal with! + +```python +x: Fuckit = ... +``` + +This is equivilant to: + +```python +x: Any = ... +``` + ## Versioning The web devs tell me that fuckit's versioning scheme is confusing, and that I should use "Semitic Versioning" instead. So starting with fuckit version `ה.ג.א`, package versions will use Hebrew Numerals. diff --git a/fuckit.py b/fuckit.py index b8ed117..7c33b65 100755 --- a/fuckit.py +++ b/fuckit.py @@ -56,7 +56,9 @@ import ast import sys import types +import typing +Fuckit = typing.Any class _fuckit(types.ModuleType): # We overwrite the sys.modules entry for this function later, which will @@ -204,4 +206,4 @@ def __exit__(self, exc_type, exc_value, traceback): return exc_type is None or issubclass(exc_type, Exception) -sys.modules[__name__] = _fuckit('fuckit', __doc__) +sys.modules[__name__] = _fuckit('fuckit', 'Fuckit', __doc__)