1- from typing import TYPE_CHECKING , Any , Optional , Union
1+ from typing import TYPE_CHECKING , Any
22
33import click
44from ape .cli import PromptChoice
@@ -19,7 +19,7 @@ class AddressPromptChoice(PromptChoice):
1919
2020 def __init__ (
2121 self ,
22- hd_path : Union [ "HDBasePath" , str ] ,
22+ hd_path : "HDBasePath | str" ,
2323 index_offset : int = 0 ,
2424 page_size : int = DEFAULT_PAGE_SIZE ,
2525 ):
@@ -31,7 +31,7 @@ def __init__(
3131 self ._hd_root_path = hd_path
3232 self ._index_offset = index_offset
3333 self ._page_size = page_size
34- self ._choice_index : Optional [ int ] = None
34+ self ._choice_index : int | None = None
3535
3636 # Must call ``_load_choices()`` to set address choices
3737 super ().__init__ ([])
@@ -48,9 +48,7 @@ def _prompt_message(self) -> str:
4848 f"or type 'n' for the next { self ._page_size } entries"
4949 )
5050
51- def convert (
52- self , value : Any , param : Optional ["Parameter" ], ctx : Optional ["Context" ]
53- ) -> Optional [str ]:
51+ def convert (self , value : Any , param : "Parameter | None" , ctx : "Context | None" ) -> str | None :
5452 """Convert the user selection to a choice or increment /decrement
5553 if they input ``n`` or ``p``."""
5654 if self ._page_from_choice (value ):
0 commit comments