Closed MaxG87 closed 2 years ago
I managed to simplify the type annotations a bit. Now the options_func_map
is not an optional function anymore, but a mandatory with a default value. This does not affect how users interact with the framework. However, it allows to use OPTIONS_MAP_VALUE_T
throughout, without having to use the default Tuple[str, int]
anywhere.
nice, I'll have a look soon
I'd rather have this splitted to two seperate PRs
Hi, could you please make the follow-up PR?
Also I'm considering refactor the project with blessed https://github.com/wong2/pick/issues/58
This PR will introduce Poetry as only tool to manage the project and add extensive type hints.
The part about Poetry is quite uncontroversial, since there is already an open ticket for that. Thus, this PR fixes #41.
The introduction of type hints is what brought me here. I would like to have them in another project. Unfortunately, this introduces severe complexity into the code base. I tried to mitigate this by always returning a list of selections, but the problem still remains. Since it only reflects the complexity inherent to the Picker class, I decided to proceed anyways. Some further improvements might be possible by using
@overload
annotations fromtyping
, but I wanted to get some feedback before I proceed with that.Fortunately, most of the type hint complexity affects the
Picker
class itself. For someone who only uses thepick
function, everything is quite obvious.I hope that this PR is helpful to you. If you feel uncomfortable about the type hint stuff, I could separate this into another PR and refine it there.