Skip to content

Commit

Permalink
python 3.9 type hint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownUser95 authored and anafvana committed Jul 27, 2024
1 parent 8fff8df commit 9693db3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pickpack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import enum
from _curses import window
from dataclasses import dataclass, field
from typing import Any, Callable, TypeAlias, TypeVar
from typing import Any, Callable, TypeVar, Union

from anytree import Node, RenderTree

Expand All @@ -19,10 +19,10 @@
KEYS_UP = (curses.KEY_UP, ord('k'))
KEYS_DOWN = (curses.KEY_DOWN, ord('j'))
KEYS_SELECT = (curses.KEY_RIGHT, ord(' '))

NodeWithIndex: TypeAlias = tuple[str | Node, int]
NodeNameOnly: TypeAlias = str | Node
AnyNode: TypeAlias = NodeNameOnly | NodeWithIndex
NodeWithIndex = tuple[Union[str, Node], int]
NodeNameOnly = Union[str, Node]
AnyNode = Union[NodeNameOnly, NodeWithIndex]

_T = TypeVar("_T")

Expand Down
1 change: 1 addition & 0 deletions src/pickpack/anytree_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" anytree_utils.py """
from __future__ import annotations

from anytree import Node, RenderTree, find

Expand Down

0 comments on commit 9693db3

Please sign in to comment.