-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] keys_of() method #13
Comments
Yes, I think
Your observation about feature-creep is good. Software and libraries have the tendency of overdoing. See Netscape for example. And the the KISS and YAGNI principles are always valid. I suppose the questions we have to answer to ourselves when we want to add another feature to our class / library / app are:
IMHO the answer to these questions, in this case, are yes, inherent, no. |
Closed per #17 |
Reopening for implementing it also in the C Extension. |
keys_of(value, deep=False)
method should return a generator, that checks infrozendict
values if they are equal tovalue
. If yes, the keys are yielded.If
deep=True
,value
does not match the current value and it's a iterable, that is not an iterator-like or a set-like, the function will search recursively for the value in the iterable and any sub-iterable. If the iterable is a sequence, the indexes of the value is yielded. If it's a map-like, the keys are yielded.Example:
See also #14
The text was updated successfully, but these errors were encountered: