Skip to content

Commit

Permalink
Docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
hakancelikdev committed Nov 17, 2023
1 parent 63f9297 commit 1d2847e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
12 changes: 12 additions & 0 deletions docs/tutorial/supported-behaviors.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Unimport can understand that imports are used these cases.

```python
from typing import List, Dict


def test(arg: List[Dict]) -> None:
pass
```
Expand All @@ -16,12 +18,16 @@ Unimport supports the following cases

```python
from typing import List, Dict


def test(arg: 'List[Dict]') -> None:
pass
```

```python
from typing import List, Dict


def test(arg: "List['Dict']") -> None:
pass
```
Expand All @@ -38,6 +44,8 @@ Imports in the example below aren't flag as unused by import.
from typing import Any
from typing import Tuple
from typing import Union


def function(a, b):
# type: (Any, str) -> Union[Tuple[None, None], Tuple[str, str]]
pass
Expand Down Expand Up @@ -65,6 +73,7 @@ Other supported operations, **append** and **extend**
```python
from os import *


__all__ = []
__all__.append("removedirs")
__all__.extend(["walk"])
Expand All @@ -75,6 +84,7 @@ after refactoring
```python
from os import removedirs, walk


__all__ = []
__all__.append("removedirs")
__all__.extend(["walk"])
Expand All @@ -94,6 +104,7 @@ Let me give a few examples.
```python
import x


def func():
import x

Expand All @@ -118,6 +129,7 @@ def func():
```python
import x


class Klass:

def f(self):
Expand Down
13 changes: 5 additions & 8 deletions tests/cases/analyzer/statement/match_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@


NAMES: List[Name] = [
Name(lineno=3, name='sort_by', is_all=False),
Name(lineno=4, name='sort_by', is_all=False),
Name(lineno=5, name='sort_by', is_all=False),
]
IMPORTS: List[Union[Import, ImportFrom]] = [
]
UNUSED_IMPORTS: List[Union[Import, ImportFrom]] = [

Name(lineno=3, name="sort_by", is_all=False),
Name(lineno=4, name="sort_by", is_all=False),
Name(lineno=5, name="sort_by", is_all=False),
]
IMPORTS: List[Union[Import, ImportFrom]] = []
UNUSED_IMPORTS: List[Union[Import, ImportFrom]] = []

0 comments on commit 1d2847e

Please sign in to comment.