Skip to content
Discussion options

You must be logged in to vote

In Z0Z_tools, I've been modernizing and adding type annotations to toolz and cytoolz.

Awesome 💪

I haven't used optype before. If I were to raise the Python minimum to 3.12, would optype be a good fit for these packages?

Yea definitely!

For example, itertoolz.pluck and itertoolz.get accepts anything with a __getitem__ method, so optype.CanGetitem[K, V] would be the most correct solution (Sequence/Mapping needlessly require a bunch of extra methods like __len__ and __contains__ to be present, even though these aren't used at all).

And for itertools.merge_sorted and other sorted-like functions such as topk only require the items to be comparible, for which optype.CanLt and optype.CanGt a…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hunterhogan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants