Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pomponchik committed Jul 15, 2024
1 parent d766aea commit 5dd5e34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/types_of_tokens/DefaultToken.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
`DefaultToken` is a type of token that cannot be revoked. Otherwise, it behaves like a regular token, but if you try to cancel it, you will get an exception:

```python
from cantok import AbstractToken, DefaultToken

DefaultToken().cancel()
#> ...
#> cantok.errors.ImpossibleCancelError: You cannot cancel a default token.
Expand All @@ -11,8 +13,6 @@ In addition, you cannot embed other tokens in `DefaultToken`.
It is best to use `DefaultToken` as the default argument for functions:

```python
from cantok import AbstractToken, DefaultToken

def function(token: AbstractToken = DefaultToken):
...
```

0 comments on commit 5dd5e34

Please sign in to comment.