Skip to content

Commit fa93160

Browse files
authored
Fix type hings
1 parent 40751a9 commit fa93160

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/pyscript/_node_parser.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from collections import defaultdict
99
from itertools import chain, filterfalse
1010
from pathlib import Path
11+
from typing import DefaultDict
1112

1213
from ._supported_packages import PACKAGE_RENAMES, PYODIDE_PACKAGES, STANDARD_LIBRARY
1314

@@ -65,9 +66,9 @@ def __repr__(self) -> str:
6566

6667
class FinderResult:
6768
def __init__(self) -> None:
68-
self._packages = set()
69-
self._locals = set()
70-
self._unsupported = defaultdict(set)
69+
self._packages: set[str] = set()
70+
self._locals: set[str] = set()
71+
self._unsupported: DefaultDict[str, set] = defaultdict(set)
7172

7273
def add_package(self, pkg_name: str) -> None:
7374
self._packages.add(pkg_name)

tests/test_cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class Dependency:
2525
This class is a general abstraction over both external and local module dependency."""
2626

2727
import_line: str # Import line to inject in code under test
28-
filename: str = None # filename: to be used for tmp local modules, i.e. paths
29-
code: str = None # code in the tmp local modules
30-
inject: str = None # any code to inject in code under test
28+
filename: str | None = None # filename: to be used for tmp local modules, i.e. paths
29+
code: str | None = None # code in the tmp local modules
30+
inject: str | None = None # any code to inject in code under test
3131

3232

3333
@pytest.fixture()

0 commit comments

Comments
 (0)