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 Fuckit type. #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link

Choose a reason for hiding this comment

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

Suggested change
This is equivilant to:
This is equivalent 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.
Expand Down
4 changes: 3 additions & 1 deletion fuckit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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__)